List of state names to register on the new instance or a map of state names and their attributes.
The machine instance. You can inherit from it by createChild to make more copies, which are efficient.
Using a list of names:
import { machine } from 'asyncmachine'
let states = machine(['A', 'B','C'])
states.A = { add: ['B'] }
states.add('A')
states.is() // -> ['A', 'B']
Using a map:
import { machine } from 'asyncmachine'
let states = machine({
A: { add: ['B'] },
B: {},
C: {}
})
states.add('A')
states.is() // -> ['A', 'B']
Generated using TypeDoc
Factory function which creates an AsyncMachine instance with specified states.
States properties are empty, so you'd need to define the relations by yourself.