This file contains hidden or 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 hidden or 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 hidden or 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 childMachine = Machine({ | |
| initial : "child1", | |
| states : { | |
| child1 : { | |
| on : { | |
| CHILD : "child2", | |
| }, | |
| }, | |
This file contains hidden or 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 fetchMachine = Machine({ | |
| id: "delay + state", | |
| type: "parallel", | |
| context : { | |
| fetched : false, | |
| }, | |
| on : { | |
| FETCHED : { |
This file contains hidden or 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 fetchMachine = Machine({ | |
| id: "delay + state", | |
| type: "parallel", | |
| states: { | |
| status: { | |
| initial: "intros", | |
| states: { | |
| intros: { | |
| after: { |
This file contains hidden or 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 menuMachine = Machine({ | |
| id : "menu", | |
| initial : "booting", | |
| states : { | |
| booting : { | |
| on : { | |
| // First-time client launches with services | |
| BOOTING_FTUE : "ftue", |
This file contains hidden or 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 machine = Machine({ | |
| id: "menu", | |
| initial: "initialize", | |
| states: { | |
| initialize: { | |
| on: { | |
| CONNECTION: [{ | |
| cond: (ctx, { lan } = false) => lan, | |
| actions: assign({ | |
| lan: true, |
This file contains hidden or 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 machine = Machine({ | |
| id: "menu", | |
| initial: "initialize", | |
| states: { | |
| initialize : { | |
| on : { | |
| CONNECTION : [{ | |
| cond : (ctx, { lan }) => lan, | |
| target : "lan", | |
| }, { |
This file contains hidden or 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 fetchMachine = Machine({ | |
| id: 'fetch', | |
| initial: 'idle', | |
| context: { | |
| retries: 0 | |
| }, | |
| states: { | |
| idle: { | |
| on: { | |
| "": { |
This file contains hidden or 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 |