Skip to content

Instantly share code, notes, and snippets.

@austinsamsel
austinsamsel / machine.js
Last active April 23, 2021 20:53
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - actions
// - XState (all XState exports)
const sessionDefinition = {
@austinsamsel
austinsamsel / machine.js
Last active April 8, 2021 00:30
Generated by XState Viz: https://xstate.js.org/viz
TRANSFER_STATES = {
IDLE: 'idle',
ERROR: 'error',
VALIDATING_USERNAME: 'validating_username',
VALIDATING_FLOW_ADDRESS: 'validating_flow_address',
CREATING_TRANSFER: 'creating_transfer',
POLLING_FOR_INVOCATION: 'polling_for_invocation',
SUCCESS: 'success',
BLOCKED: 'blocked',
}
@austinsamsel
austinsamsel / machine.js
Last active March 20, 2021 16:45
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 March 12, 2021 20:13
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
@austinsamsel
austinsamsel / machine.js
Last active March 11, 2021 16:08
Generated by XState Viz: https://xstate.js.org/viz
const IGNORE_ERRORS_DURATION = 3000;
const FS = {
IDLE: 'idle',
UNSEALED_RESET: 'unsealed_reset',
UNSEALED_ERROR: 'unsealed_error',
OPENING: 'opening',
GETTING_MOMENTS: 'getting_moments',
}
@austinsamsel
austinsamsel / machine.js
Last active December 15, 2020 16:24
Generated by XState Viz: https://xstate.js.org/viz
const createMachine = ({...props}) => {
return Machine({...props})
}
const ERROR_MESSAGES = {
GENERAL: 'There was an error.'
}
const showcases = [
{
@austinsamsel
austinsamsel / machine.js
Last active November 25, 2020 14:31
Generated by XState Viz: https://xstate.js.org/viz
TRANSFER_STATES = {
IDLE: 'idle',
VALIDATING_USERNAME: 'validating_username',
VALIDATING_FLOW_ADDRESS: 'validating_flow_address',
CREATING_TRANSFER: 'creating_transfer',
POLLING_FOR_INVOCATION: 'polling_for_invocation',
SUCCESS: 'success',
}
Machine({
@austinsamsel
austinsamsel / machine.js
Last active November 10, 2020 22:47
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 September 18, 2020 19:28
Generated by XState Viz: https://xstate.js.org/viz
const IGNORE_ERRORS_DURATION = 3000;
const FS = {
IDLE: 'idle',
UNSEALED_RESET: 'unsealed_reset',
OPENING: 'opening',
UNSEALED_RETRYING: 'unsealed_retrying',
POLLING_PACK: 'polling_pack',
GETTING_MOMENTS: 'getting_moments',
DONE: 'done',