Skip to content

Instantly share code, notes, and snippets.

@austinsamsel
austinsamsel / machine.js
Last active June 16, 2021 17:44
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active June 16, 2021 17:26
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active May 6, 2021 21:11
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active May 5, 2021 19:02
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active May 5, 2021 19:02
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active May 5, 2021 14:04
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active May 5, 2021 13:50
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active April 30, 2021 15:46
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active April 27, 2021 22:14
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@austinsamsel
austinsamsel / machine.js
Last active April 26, 2021 16:38
Generated by XState Viz: https://xstate.js.org/viz
// 1. when user accesses the site, we immediately check for an existing session (amazon cognito), wallet (dapper).
// 2. if there's some data for the session or wallet, we'll assign it to context, otherwise it'll be null.
// 3. if there's some data for the session, we'll pass along a token to the BE to get the user's profile from the API. if there's no reason to make the request, we can skip it and drive the state forward to IDLE.
// 4. from IDLE, we can await user action. not worrying about "checks" for appropriate actions right now, especially since flows are not yet determined.
// NOTE: a REDIRECT means user is leaving site and upon returning the machine "starts over" from LOADING_SESSION