This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const initialState = 'inactive'; | |
const toggleMachine = Machine({ | |
id: 'toggle', | |
initial: initialState, | |
states: { | |
inactive: { // 'inactive' state | |
on: { // "on event, transition to state..." | |
TOGGLE: 'active' // on event 'TOGGLE', transition to 'active' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const level_active_high = { | |
initial: 'inactive', | |
states: { | |
inactive: { | |
on: { | |
HW_HIGH: 'active' | |
} | |
}, | |
active: { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const machine = Machine({ | |
id: 'sensor', | |
initial: 'inactive', | |
states: { | |
inactive: { | |
on: { | |
HW_HIGH: 'active' | |
} | |
}, | |
active: { |
OlderNewer