Skip to content

Instantly share code, notes, and snippets.

View wmcbain's full-sized avatar

Wyatt McBain wmcbain

View GitHub Profile
@wmcbain
wmcbain / machine.js
Last active March 5, 2020 17:02
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@wmcbain
wmcbain / machine.js
Last active March 5, 2020 19:43
Generated by XState Viz: https://xstate.js.org/viz
const authMachine = Machine({
id: 'auth_machine',
initial: 'authIsLoading',
context: {
sessionToken: null,
},
states: {
// HomeScreen.tsx
authIsLoading: {
on: {
@wmcbain
wmcbain / machine.js
Last active March 12, 2020 00:05
Generated by XState Viz: https://xstate.js.org/viz
const authMachine = Machine({
id: 'auth_machine',
initial: 'authIsLoading',
context: {
sessionToken: null,
},
states: {
// HomeScreen.tsx
authIsLoading: {
on: {
@wmcbain
wmcbain / machine.js
Last active March 14, 2020 17:45
Generated by XState Viz: https://xstate.js.org/viz
const authMachine = Machine({
id: 'auth_machine',
initial: 'authIsLoading',
context: {
sessionToken: null,
},
states: {
authIsLoading: {
on: {
LOGGED_IN: 'isLoggedIn',
@wmcbain
wmcbain / machine.js
Last active March 18, 2020 20:48
Generated by XState Viz: https://xstate.js.org/viz
const authMachine = Machine({
id: 'auth_machine',
initial: 'authIsLoading',
context: {
sessionToken: null,
},
states: {
authIsLoading: {
on: {
LOGGED_IN: 'isLoggedIn',
@wmcbain
wmcbain / machine.js
Created April 6, 2020 16:34
Generated by XState Viz: https://xstate.js.org/viz
const fileMachine = Machine({
id: 'fileMachine',
initial: 'checkPackageJsonChanged',
states: {
checkPackageJsonChanged: {
entry: 'checkPackageJsonChanged',
on: {
PACKAGE_JSON_CHANGED: 'checkUniversalPackagesChanged',
PACKAGE_JSON_NOT_CHANGED: 'exit'
@wmcbain
wmcbain / machine.js
Created June 2, 2020 17:09
Generated by XState Viz: https://xstate.js.org/viz
const authMachine = Machine({
id: 'auth_machine',
initial: 'authIsLoading',
context: {
sessionToken: null,
},
states: {
authIsLoading: {
on: {
LOGGED_IN: 'isLoggedIn',