Skip to content

Instantly share code, notes, and snippets.

View sebastiancarlsson's full-sized avatar

Sebastian Carlsson sebastiancarlsson

View GitHub Profile
@sebastiancarlsson
sebastiancarlsson / machine.js
Last active September 27, 2021 09:25
Generated by XState Viz: https://xstate.js.org/viz
const EVENTS = {
// User action
CHANGE_TAB: 'change_tab',
PREV_STEP: 'prev_step',
NEXT_STEP: 'next_step',
UPDATE_SETTING: 'update_setting',
UPDATE_NAME: 'update_name',
CREATE_CUSTOM_EXPERIMENT: 'create_custom_experiment',
CREATE_EXPERIMENT_WITH_SETTINGS: 'create_experiment_with_settings',
CANCEL: 'cancel'
@sebastiancarlsson
sebastiancarlsson / machine.js
Last active September 27, 2021 09:19
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@sebastiancarlsson
sebastiancarlsson / machine.js
Created September 22, 2021 14:13
Generated by XState Viz: https://xstate.js.org/viz
const todoMachine = Machine({
initial: 'pending',
context: {
description: 'This is my todo'
},
states: {
pending: {
on: {
DONE: 'done',
@sebastiancarlsson
sebastiancarlsson / machine.js
Last active September 23, 2021 12:18
Generated by XState Viz: https://xstate.js.org/viz
const trafficLightMachine = Machine({
initial: 'green',
states: {
green: {
on: {
TICK_EVENT: 'yellow'
}
},
yellow: {
on: {