State Handler
Trigger execution chains based on the state of injected parameters.
If a function within the chain returns false
the execution chain stops and
the next function will not be called.
Install
npm install state-handler --save
example
const StateHandler = // some example stateconst state = items: complete: false const sh = // arguments can be an array or a list of parameterssh stateitemssh // NOP stateitemssh // exec stateitemsstateitems sh // NOP
StateHandler accepts an arbitrary length of parameters, e.g.:
const sh = sh // modify state sh
Download
- Development version: https://npmcdn.com/state-handler/dist/exec.js
- Minified version: https://npmcdn.com/state-handler/dist/exec.min.js