AsyncMachine Dry Wet Example

node v8.17.0
version: master
endpointsharetweet
This basic examples makes use of: `states`, `transitions`, `relations` and `synchronous mutations`. https://github.com/TobiaszCudnik/asyncmachine
const { machine } = require('asyncmachine') // define const state = { Wet: { require: ['Water'] }, Dry: { drop: ['Wet'] }, Water: { add: ['Wet'], drop: ['Dry'] } } // initialize const example = machine(state) // make changes example.add('Dry') example.add('Water') // check the state example.is() // -> [ 'Wet', 'Water' ]
Loading…

no comments

    sign in to comment