Closed abierbaum closed 8 years ago
Sorry for the incredibly delayed response. Currently, flow-js doesn't have any internal support for this sort of thing. You could always write little wrappers for catching success or failure and then moving to the next step of the flow with some sort of status indicator:
flow.exec(
function() {
var flow = this;
function success(params) { flow('success', params) }
function failure(params) { flow('failure', params) }
myRequest(success, failure);
},function(status, params) {
if (status === 'success') { ... }
}
)
I really like the way the code for flow-js looks, but I am having trouble wrapping my head around how I could call an async method that takes two callback methods. One for success and one for failure.
Example method:
I would need a flow that chooses the next method to hit in the flow based upon the success or failure. Something like:
So on success the flow would be: step1, step2, step3. On failure it would be: step1, step1 error, throw.
Is this possible?