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
{"lastUpload":"2020-08-13T21:17:43.688Z","extensionVersion":"v3.4.3"} |
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
// * Stubbed out methods so we can copy the machine to the xstate visualizer | |
const fetchAll = () => {} | |
const setRemoteData = () => {} | |
const isDeselectingLastSelectedItem = () => {} | |
const selectMenuItem = () => {} | |
const deselectMenuItem = () => {} | |
const isNotCreated = (ctx, e) => false | |
const isNotYetActive = (ctx, e) => false | |
const hasOrderedAndIsActive = (ctx, e) => false | |
const hasOrderedAndIsExpired = (ctx, e) => false |
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
My Awesome Sketch | |
First State | |
some event -> Second State | |
Second State |
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
const dogFetcherMachine = Machine({ | |
id: "dog fetcher", | |
initial: "idle", | |
context: { | |
dog: null, | |
error: null | |
}, | |
states: { | |
idle: { | |
on: { FETCH: "loading" } |
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 |
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
// * Stubbed out methods so we can copy the machine to the xstate visualizer | |
const fetchAll = () => {} | |
const setRemoteData = () => {} | |
const isDeselectingLastSelectedItem = () => {} | |
const selectMenuItem = () => {} | |
const deselectMenuItem = () => {} | |
const isNotCreated = (ctx, e) => false | |
const isNotYetActive = (ctx, e) => false | |
const hasOrderedAndIsActive = (ctx, e) => false | |
const hasOrderedAndIsExpired = (ctx, e) => false |
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
// There must be exactly one initial state, which implies | |
// there must be at least one finite state. | |
// const dullHuman = Machine({ | |
// id: 'dullHuman', | |
// initial: 'idle', | |
// states: { | |
// idle: {} | |
// } | |
// }) |
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
const birthday = Machine({ | |
id: "birthday", | |
initial: "notStarted", | |
states: { | |
started: { | |
initial: "boring", | |
entry: (ctx, e) => console.log('Parent entry action executed'), | |
exit: (ctx, e) => console.log('Parent exit action executed'), | |
on: { | |
CAKE_BONANZA: { |
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
const gathering = Machine({ | |
id: "gathering", | |
initial: "started", | |
states: { | |
started: { | |
entry: (ctx, e) => console.log('"Started" entry action executed'), | |
exit: (ctx, e) => console.log('"Started" exit action executed'), | |
on: { | |
SAME_SAME: { | |
target: "started", |
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 |
OlderNewer