Skip to content

Instantly share code, notes, and snippets.

@gregplaysguitar
Last active December 18, 2019 02:00
Show Gist options
  • Save gregplaysguitar/299a43349ce0b747041ec353a5461c62 to your computer and use it in GitHub Desktop.
Save gregplaysguitar/299a43349ce0b747041ec353a5461c62 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const actionCardsMachine = Machine({
id: "actionCards",
initial: "initial",
context: {
retries: 0
},
states: {
initial: {
on: {
ASSEMBLE: "pending",
}
},
pending: {
on: {
PUBLISH: "active",
EMBARGO: "embargoed"
}
},
active: {
on: {
DISMISS: "dismissed",
COMPLETE: "completed",
SNOOZE: "snoozed",
EXPIRE: "expired"
}
},
snoozed: {
on: {
UNSNOOZE: "active",
EXPIRE: "expired"
}
},
embargoed: {
on: {
PUBLISH: "active"
}
},
expired: {
type: "final"
},
completed: {
type: "final"
},
dismissed: {
type: "final"
}
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment