Created
January 30, 2020 03:55
-
-
Save UberMouse/2df2809492350b9b86b287d0cd38c6fa to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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 RepositoryMachine = Machine({ | |
key: "repository", | |
initial: "noRepositorySelected", | |
states: { | |
noRepositorySelected: { | |
on: { | |
REPOSITORY_SELECTED: { | |
target: "viewingChanges", | |
actions: assign({ | |
selectedRepository: (_ctx, event) => event.repository | |
}) | |
} | |
} | |
}, | |
viewingChanges: { | |
on: { | |
HISTORY_SELECTED: "viewingHistory" | |
}, | |
states: { | |
noLayerSelected: { | |
on: { | |
LAYER_SELECTED: { | |
target: "layerSelected", | |
actions: assign({ | |
selectedLayer: (_ctx, event) => event.layer | |
}) | |
} | |
} | |
}, | |
layerSelected: {} | |
} | |
}, | |
viewingHistory: { | |
on: { | |
CHANGES_SELECTED: "viewingChanges" | |
}, | |
states: { | |
noCommitSelected: { | |
on: { | |
COMMIT_SELECTED: { | |
target: "commitSelected", | |
actions: assign({ | |
selectedCommit: (_ctx, event) => event.commit | |
}) | |
} | |
} | |
}, | |
commitSelected: {} | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment