Skip to content

Instantly share code, notes, and snippets.

@loklaan
Last active June 2, 2021 23:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save loklaan/2eed271021482c24344fd74b69d1aa8c to your computer and use it in GitHub Desktop.
Save loklaan/2eed271021482c24344fd74b69d1aa8c to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
// - XState (all XState exports)
const fetchMachine = Machine({
initial: 'list',
context: { activeColumn: null },
states: {
list: {
on: {
TO_FILTER: {
target: 'filter',
actions: assign({
activeColumn: (context, event) =>
event.type === 'TO_FILTER' ? event.activeColumn : undefined,
}),
},
},
},
filter: {
on: {
TO_LIST: {
target: 'list',
},
},
},
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment