Clone and edit this document
Runkit
Runkit
home page
user forum
new notebook
clone notebook
download notebook
support & documentation
log in
sign up
new notebook
help & feedback
clone this notebook
download this notebook
Sign In
Sign Up
AsyncMachine Dry Wet Example
node v8.17.0
version:
master
endpoint
share
tweet
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