Skip to content

Instantly share code, notes, and snippets.

@nickbreaton
Last active June 14, 2020 20:22
Show Gist options
  • Select an option

  • Save nickbreaton/0ecb7e632d56357376c69d4ae6602119 to your computer and use it in GitHub Desktop.

Select an option

Save nickbreaton/0ecb7e632d56357376c69d4ae6602119 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)
function delay(timeout) {
return new Promise(res => {
setTimeout(res, timeout)
})
}
function writeEntrypoint() {
}
const devCommandrMachine = Machine({
id: 'dev-command',
initial: 'setup',
states: {
setup: {
invoke: {
src: () => delay(20),
onDone: 'ready',
}
},
ready: {
type: 'parallel',
states: {
clientBuild: {
initial: 'building',
states: {
building: {},
}
},
serverBuild: {
initial: 'building',
states: {
building: {}
}
},
devServer: {
initial: 'pendingRequest',
states: {
pendingRequest: {}
}
}
}
}
// pendingRequest: {
// on: {
// REQUEST: {
// target: 'writingEntryPoint',
// actions: assign({ url: (_, event) => event.url })
// }
// }
// },
// writingEntryPoint: {
// invoke: {
// id: 'write entrypoint'
// }
// }
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment