Last active
August 29, 2015 14:17
-
-
Save nijikokun/561ddc573cee4ffc14a5 to your computer and use it in GitHub Desktop.
Async flow for ES5/6 (Purely thought / psuedocode)
This file contains hidden or 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
flo = flow | |
// Add method signature and arguments to be invoked | |
.add(/* [name, ]function[, arguments...] */) | |
// Attach thenable to previous method signature | |
.then(function () { | |
// skip(/* string name | int groups */) | |
flo.skip('name') // this.skip vs flo.skip vs (skip argument on argument list, after next) | |
// next(/* string name | int group */) | |
// sugar for #jump(/* string name | int group */) | |
flo.next() // this.next vs flo.next vs (next argument on argument list) | |
}) | |
// Add another grouping | |
.add('name', request, args) | |
.then(/* function(args...) */) | |
// Un-attached thenable, invoked if everything goes okay | |
// #skip('global') to skip | |
.then(...) | |
.catch(/* [ErrorType, ]function(args...) */) | |
.finally(/* function args(...) */) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment