Last active
December 18, 2019 02:00
-
-
Save gregplaysguitar/299a43349ce0b747041ec353a5461c62 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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