gaffa-flow
Version:
An action for triggering other actions after a flow of model events occurs
53 lines (28 loc) • 853 B
Markdown
flow action for gaffa
npm i gaffa-flow
gaffa.registerConstructor(require('gaffa-flow'));
Binding that, when changed to a truthy value, cancels the flow.
A standard array of bindings that when evaluate to true will trigger the next step to be evaluated.
Once all steps have evaluated to true the success action will be triggered
var flow = new Flow();
flow.steps = [
'[/foo]',
'[/bar]'
];
flow.actions.success[someAction];
// Step 1
gaffa.model.set('[/foo]', true);
setTimeout(function(){
// Step 2
gaffa.model.set('[/bar]', true);
}, 1000);
// After step 2 is set someAction will trigger