const StateMachine = require('.');

const fsm = StateMachine({
  initial: 'green',
  events: [
    { name: 'warn',  from: 'green',  to: 'yellow' },
    { name: 'panic', from: 'yellow', to: 'red'    },
    { name: 'calm',  from: 'red',    to: 'yellow' },
    { name: 'clear', from: 'yellow', to: 'green'  }
  ]
}, {
  one: 'one'
});

console.log(fsm);

fsm.warn().then(() => {
  console.log('123');
});
