Skip to content

Instantly share code, notes, and snippets.

@Colubi
Colubi / machine.js
Last active October 16, 2019 11:45
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: "optIn",
type: "parallel",
context: {
optInResult: "initial",
optInRequest: {
successState: "Success",
},
},
states: {
@Colubi
Colubi / machine.js
Created October 14, 2019 11:59
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: "optIn",
type: "parallel",
context: {
optInState: "initial",
optInRequest: {
successState: "Success",
},
},
states: {
@Colubi
Colubi / machine.js
Created November 21, 2019 14:46
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: "gameLauncher",
type: "parallel",
context: {
error: null,
launchedGame: null,
launchRequest: null,
},
states: {
launcher: {
@Colubi
Colubi / machine.js
Created December 16, 2019 15:30
Generated by XState Viz: https://xstate.js.org/viz
Machine({
id: "fetch",
initial: "idle",
context: {
request: null,
data: null,
error: null,
retries: 0,
maxRetries: 3,
},
@Colubi
Colubi / machine.js
Created December 18, 2019 11:07
Generated by XState Viz: https://xstate.js.org/viz
const allowRetry = (retries, maxRetries) => retries < maxRetries;
const FetchMachine = Machine({
id: "fetch",
initial: "idle",
context: {
request: null,
data: null,
error: null,
retries: 0,
maxRetries: 0,
@Colubi
Colubi / machine.js
Created December 18, 2019 11:07
Generated by XState Viz: https://xstate.js.org/viz
const allowRetry = (retries, maxRetries) => retries < maxRetries;
const FetchMachine = Machine({
id: "fetch",
initial: "idle",
context: {
request: null,
data: null,
error: null,
retries: 0,
maxRetries: 0,
@Colubi
Colubi / machine.js
Created December 18, 2019 11:09
Generated by XState Viz: https://xstate.js.org/viz
const allowRetry = (retries, maxRetries) => retries < maxRetries;
const FetchMachine = Machine({
id: "fetch",
initial: "idle",
context: {
request: null,
data: null,
error: null,
retries: 0,
maxRetries: 0,