Skip to content

Instantly share code, notes, and snippets.

View maroonblazer's full-sized avatar

Maroonblazer maroonblazer

View GitHub Profile
@maroonblazer
maroonblazer / machine.js
Last active August 22, 2020 17:56
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@maroonblazer
maroonblazer / machine.js
Created August 11, 2019 11:56
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// Available variables:
// Machine (machine factory function)
// assign (action)
// XState (all XState exports)
const fetchMachine = Machine({
id: 'fetch',
context: { attempts: 0 },
initial: 'idle',
@maroonblazer
maroonblazer / machine.js
Last active July 28, 2019 18:19
Generated by XState Viz: https://xstate.js.org/viz
const machine = Machine({
initial: 'Off',
states: {
Off: {
on: {
FLICK: 'On'
},
initial: 'A',
states: {
A: {
@maroonblazer
maroonblazer / machine.js
Last active July 28, 2019 18:16
Generated by XState Viz: https://xstate.js.org/viz
const theMachine = Machine({
initial: 'OFF',
states: {
OFF: {
on: {
FLICK: 'ON'
},
initial: 'A',
states: {
A: {
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
Off*
flick -> On
A*
B
On
flick -> Off
@maroonblazer
maroonblazer / machine.js
Last active July 27, 2019 22:22
Generated by XState Viz: https://xstate.js.org/viz
const theMachine = Machine({
initial: 'off',
states: {
off: {
on: {
flick: 'on'
}
},
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions