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
| // 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 walletMachine = Machine({ | |
| id: 'wallet', | |
| initial: 'loadingMangoInfo', | |
| states: { | |
| idle: { | |
| on: { LOAD_MANGO_INFO: 'loadingMangoInfo' }, | |
| }, | |
| loadingMangoInfo: { | |
| on: { | |
| CREAT_ACCOUNT: 'createAccount', |
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 fetchProducts = (productCategory) => { | |
| return Promise.resolve([ | |
| { | |
| name: 'Cheese', | |
| price: 250, | |
| }, | |
| { | |
| name: 'Crisps', | |
| price: 300, | |
| }, |
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 paymentAuthorizationMachine = Machine( | |
| { | |
| id: "paymentAuthorization", | |
| initial: "checkPrerequisites", | |
| // we will track payment authorization details in the machine's context | |
| context: { | |
| paymentAuthorizationId: null, | |
| expiresOn: null, | |
| // ...more fields | |
| }, |
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 firestoreFetchMachine = Machine({ | |
| id: "myMachine", | |
| initial: "idle", | |
| context: { doc: { products: "a product" } }, | |
| states: { | |
| idle: { | |
| on: { | |
| INIT: "init" | |
| } | |
| }, |
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
| {"lastUpload":"2021-12-19T11:22:07.544Z","extensionVersion":"v3.4.3"} |