aerostate

0.0.3 • Public • Published

ES6 async fluent state machine

var data = {progress: []}
var state = new Aerostate('green')
  .always(() => console.log('always'))
  .when('green').perform(() => console.log('green')).then('yellow')
  .when('yellow').perform(() => console.log('yellow')).then('red')
  .when('red')
    .perform(
      () => console.log('red'), 
      (data, progress) => progress.resolve())
    .then('white')
  .run(data, data.progress)
  .then(data => console.log(data), error => console.log(error));

Package Sidebar

Install

npm i aerostate

Weekly Downloads

1

Version

0.0.3

License

MIT

Last publish

Collaborators

  • vaselok
  • vladen