Skip to content

Instantly share code, notes, and snippets.

View the-main-thing's full-sized avatar

Pavel Shevtsov the-main-thing

View GitHub Profile
@the-main-thing
the-main-thing / machine.js
Last active July 3, 2020 12:21
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@the-main-thing
the-main-thing / machine.js
Last active June 6, 2020 14:32
Generated by XState Viz: https://xstate.js.org/viz
const fetchMachine = Machine( {
id: "connection",
initial: "disconnected",
context: {
wsServerUrl: null,
socket: null,
error: null,
recievedPacket: null,
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@the-main-thing
the-main-thing / machine.js
Last active April 26, 2020 10:12
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@the-main-thing
the-main-thing / machine.js
Last active April 9, 2020 12:53
Generated by XState Viz: https://xstate.js.org/viz
const editinMachine = Machine({
id: 'editingMachine',
initial: 'idle',
context: {
id: null,
name: null,
email: null,
errorMessage: null,
},
on: {
@the-main-thing
the-main-thing / machine.js
Last active April 3, 2020 08:02
Generated by XState Viz: https://xstate.js.org/viz
// export const STATES = {
// idle: 'idle',
// ['idle.idle']: 'idle.idle',
// ['idle.creating']: 'idle.creating',
// savingNew: 'savingNew',
// savingChange: 'savingChange',
// confirmDelete: 'confirmDelete',
// ['confirmDelete.idle']: 'confirmDelete.idle',
// ['confirmDelete.creating']: 'confirmDelete.creating',
@the-main-thing
the-main-thing / machine.js
Last active March 26, 2020 09:03
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@the-main-thing
the-main-thing / machine.js
Last active March 4, 2020 15:58
Generated by XState Viz: https://xstate.js.org/viz
const id = 'databoard-inline-realtime-update'
const initialContext = {
deletingKey: null,
data: [],
currentItem: {
key: null
},
invalidInputs: {},
errorMessage: null
};
@the-main-thing
the-main-thing / machine.js
Last active February 26, 2020 10:47
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions