Created
August 11, 2015 10:08
-
-
Save vitkarpov/fe43dc1052c0211ae632 to your computer and use it in GitHub Desktop.
Условная логика в дескрипте
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
de.array([ | |
de.http(..., { | |
// идем в ручку, если есть foo в параметрах запроса | |
guard: '.foo', | |
after: function(params, context) { | |
// написали признак в стейт, что все прошло хорошо | |
context.flag = true; | |
} | |
// обязательно определить приоритет | |
}) +5, | |
// если есть признак, идем в ручку B | |
de.http(..., { | |
guard: 'state.flag' | |
}), | |
// если нет признака, идем в ручку C | |
de.http(..., { | |
guard: '!state.flag' | |
}) | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment