Skip to content

Instantly share code, notes, and snippets.

View KevinWMatthews's full-sized avatar
🦀
Studying Rust

Kevin W Matthews KevinWMatthews

🦀
Studying Rust
View GitHub Profile
@KevinWMatthews
KevinWMatthews / machine.js
Created December 1, 2019 19:00
Generated by XState Viz: https://xstate.js.org/viz
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'
}
@KevinWMatthews
KevinWMatthews / machine.js
Last active December 4, 2019 12:37
Generated by XState Viz: https://xstate.js.org/viz
const level_active_high = {
initial: 'inactive',
states: {
inactive: {
on: {
HW_HIGH: 'active'
}
},
active: {
@KevinWMatthews
KevinWMatthews / machine.js
Created December 4, 2019 13:40
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
id: 'sensor',
initial: 'inactive',
states: {
inactive: {
on: {
HW_HIGH: 'active'
}
},
active: {