0.0.4 • Published 5 years ago

astate v0.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
5 years ago

aState

aState is a JavaScript library for working with State Machines.

Example

import StateMachine from 'astate'

const state = new StateMachine({
  initial: 'off',
  off: {
    TOGGLE: 'on'
  },
  on: {
    TOGGLE: 'off'
  }
})

state.on('statechange', newState => {
  console.log(newState.activeState)
})

setInterval(() => {
  state.transition('TOGGLE')
}, 1000)
0.0.4

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago