Last active
January 17, 2020 20:09
-
-
Save llldc21/564652e4060588a6b608865475940007 to your computer and use it in GitHub Desktop.
Revisions
-
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 10 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -6,12 +6,19 @@ const fetchMachine = Machine({ }, states: { draft: { onEntry: ['test'], after: { run: [ { target: 'ok' }, { target: 'fail' } ] } }, ok: { type: 'final' }, fail: { type: 'final' } } }); -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 1 addition and 46 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ const fetchMachine = Machine({ id: 'fetch', initial: 'draft', context: { state: 'draft' @@ -8,55 +8,10 @@ const fetchMachine = Machine({ draft: { on: { READY: 'ready', } }, ready: { type: 'final' }, } }); -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,5 @@ const fetchMachine = Machine({ id: 'e-proposal', initial: 'draft', context: { state: 'draft' -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,9 @@ const fetchMachine = Machine({ id: 'fetch', initial: 'draft', context: { state: 'draft' }, states: { draft: { on: { -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,9 +1,6 @@ const fetchMachine = Machine({ id: 'fetch', initial: 'draft', states: { draft: { on: { -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -19,13 +19,13 @@ const fetchMachine = Machine({ }, queue: { on: { SEND: 'waiting' } }, inbox: { on: { CANCELED: 'canceled', SEND: 'waiting', DRAFT: 'draft' } }, -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 0 additions and 3 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -57,9 +57,6 @@ const fetchMachine = Machine({ }, deleted: { type: 'final' } } }); -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 6 additions and 4 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -39,8 +39,8 @@ const fetchMachine = Machine({ canceled: { on: { DRAFT: 'draft', }, type: 'final' }, accepted: { on: { @@ -50,8 +50,10 @@ const fetchMachine = Machine({ type: 'final' }, refused: { on: { DRAFT: 'draft' }, type: 'final' }, deleted: { type: 'final' -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -46,8 +46,8 @@ const fetchMachine = Machine({ on: { WAITING: 'waiting', CANCELED: "canceled", }, type: 'final' }, refused: { DRAFT: 'draft', -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -45,7 +45,8 @@ const fetchMachine = Machine({ accepted: { on: { WAITING: 'waiting', CANCELED: "canceled", FINAL: 'final' } }, refused: { -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -18,11 +18,14 @@ const fetchMachine = Machine({ } }, queue: { on: { WAITING: 'waiting' } }, inbox: { on: { CANCELED: 'canceled', WAITING: 'waiting', DRAFT: 'draft' } }, -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 17 additions and 12 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -15,16 +15,16 @@ const fetchMachine = Machine({ on: { QUEUE: 'queue', INBOX: 'inbox' } }, queue: { type: 'waiting' }, inbox: { on: { CANCELED: 'canceled', DRAFT: 'draft' } }, waiting: { on: { @@ -35,7 +35,8 @@ const fetchMachine = Machine({ }, canceled: { on: { DRAFT: 'draft', FINAL: 'final' } }, accepted: { @@ -45,10 +46,14 @@ const fetchMachine = Machine({ } }, refused: { DRAFT: 'draft', FINAL: 'final' }, deleted: { type: 'final' }, final: { type: 'final' } } }); -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 11 additions and 11 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -15,16 +15,16 @@ const fetchMachine = Machine({ on: { QUEUE: 'queue', INBOX: 'inbox' }, queue: { type: 'waiting' }, inbox: { on: { CANCELED: 'canceled', DRAFT: 'draft' } }, }, waiting: { on: { @@ -51,4 +51,4 @@ const fetchMachine = Machine({ type: 'final' } } }); -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 47 additions and 20 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -1,27 +1,54 @@ const fetchMachine = Machine({ id: 'fetch', initial: 'draft', context: { retries: 0 }, states: { draft: { on: { READY: 'ready', DELETED: 'deleted' } }, ready: { on: { QUEUE: 'queue', INBOX: 'inbox' } }, queue: { type: 'waiting' }, inbox: { on: { CANCELED: 'canceled', DRAFT: 'draft' } }, waiting: { on: { CANCELED: 'canceled', ACCEPTED: 'accepted', REFUSED: 'refused' } }, canceled: { on: { DRAFT: 'draft' } }, accepted: { on: { WAITING: 'waiting', CANCELED: "canceled" } }, refused: { DRAFT: 'draft' }, deleted: { type: 'final' } } }); -
llldc21 revised this gist
Jan 17, 2020 . 1 changed file with 1 addition and 8 deletions.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -20,14 +20,7 @@ type: 'final' }, failure: { type: 'final' } } }); -
llldc21 revised this gist
Jan 17, 2020 . No changes.There are no files selected for viewing
-
llldc21 created this gist
Jan 17, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ const fetchMachine = Machine({ id: 'fetch', initial: 'draft', context: { retries: 0 }, states: { draft: { on: { READY: 'ready' } }, ready: { on: { RESOLVE: 'success', REJECT: 'failure' } }, success: { type: 'final' }, failure: { on: { RETRY: { target: 'loading', actions: assign({ retries: (context, event) => context.retries + 1 }) } } } } });