Last active
January 24, 2021 19:34
-
-
Save pangratz/6a81c3860b6292baab6e14da952744b0 to your computer and use it in GitHub Desktop.
Revisions
-
pangratz revised this gist
Jan 24, 2021 . 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 @@ -38,7 +38,8 @@ unstarted: { on: { START: { target: 'started', actions: ['resetCurrentCardIndex'] } } }, -
pangratz revised this gist
Jan 24, 2021 . 1 changed file with 4 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 @@ -49,13 +49,15 @@ target: 'finished', cond: 'isLast' }, { target: 'started', actions: ['incrementCurrentCardIndex'] }], PREV: [{ target: 'unstarted', cond: 'isFirst' }, { target: 'started', actions: ['decrementCurrentCardIndex'] }] } }, -
pangratz revised this gist
Jan 24, 2021 . 1 changed file with 5 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 @@ -15,6 +15,11 @@ initial: 'overview', context: { cards: null, currentCardIndex: null }, states: { overview: { on: { -
pangratz revised this gist
Jan 24, 2021 . 1 changed file with 9 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 @@ -16,10 +16,18 @@ initial: 'overview', states: { overview: { on: { START_QUIZ: 'quiz' } }, quiz: { initial: 'unstarted', on: { CANCEL_QUIZ: 'overview' }, states: { unstarted: { -
pangratz revised this gist
Jan 24, 2021 . 1 changed file with 30 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 @@ -22,11 +22,38 @@ initial: 'unstarted', states: { unstarted: { on: { START: { target: 'started' } } }, started: { on: { NEXT: [{ target: 'finished', cond: 'isLast' }, { target: 'started' }], PREV: [{ target: 'unstarted', cond: 'isFirst' }, { target: 'started' }] } }, finished: { on: { RESTART: { target: 'unstarted' } } } } } } -
pangratz created this gist
Jan 23, 2021 .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 @@ // Available variables: // - Machine // - interpret // - assign // - send // - sendParent // - spawn // - raise // - actions // - XState (all XState exports) const fetchMachine = Machine({ id: 'house-of-cards', initial: 'overview', states: { overview: {}, quiz: { initial: 'unstarted', states: { unstarted: {}, started: {}, finished: {} } } } });