Simple full-featured finite state machine for your project
Find a file
2020-07-18 18:10:05 +03:00
src feat: add methods for getting available states 2019-11-01 12:38:59 +03:00
tests tests: add tests for 100 coverage 2019-10-19 20:19:04 +03:00
.gitignore ci: add travis config 2019-10-19 20:21:24 +03:00
.travis.yml ci: add travis config 2019-10-19 20:21:24 +03:00
jest.config.js Initial commit 2019-10-11 14:57:31 +03:00
LICENSE Initial commit 2019-10-11 14:57:31 +03:00
package-lock.json chore(deps): bump lodash from 4.17.15 to 4.17.19 2020-07-18 12:21:07 +00:00
package.json chore(deps): fix security alerts 2020-04-08 11:49:49 +03:00
README.md ci: add coveralls badge 2019-10-19 20:33:15 +03:00
tsconfig.json fix: fix bug with types 2019-10-19 20:06:18 +03:00

IT FSM

Simple finite state machine

Build Status Coverage Status

Installation

npm install --save it-fsm

Usage

import { StateMachine } from 'it-fsm';

const fsm = new StateMachine('TODO', {
  TODO: {
    complete: 'COMPLETE'
  }
})


if (fsm.can('complete')) {
  fsm.complete().then(() => {
    
  })
}
// or
if (fsm.canToState('COMPLETE')) {
  fsm.complete().then(() => {
    
  });
}