2.1.0 • Published 9 years ago

gaffa-flow v2.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
9 years ago

gaffa-flow

flow action for gaffa

Install:

npm i gaffa-flow

Add to gaffa:

gaffa.registerConstructor(require('gaffa-flow'));

API

Properties (instanceof Gaffa.Property)

cancel

Binding that, when changed to a truthy value, cancels the flow.

Properties !(instanceof Gaffa.Property)

steps

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

Example

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
2.1.0

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.0

10 years ago

0.0.8

11 years ago

0.0.7

11 years ago

0.0.6

11 years ago

0.0.5

11 years ago

0.0.4

11 years ago

0.0.3

11 years ago

0.0.2

11 years ago

0.0.1

11 years ago