untitled notebook

node v10.15.3
version: 1.0.1
endpointsharetweet
const { Machine } = require("xstate") const { getSimplePaths, getShortestPaths } = require('@xstate/graph') const machine = Machine({ id: 'feedback', initial: 'question', states: { question: { on: { CLICK_GOOD: 'thanks', CLICK_BAD: 'form', CLOSE: 'closed', ESC: 'closed' } }, form: { on: { SUBMIT: 'thanks', CLOSE: 'closed', ESC: 'closed' } }, thanks: { on: { CLOSE: 'closed', ESC: 'closed' } }, closed: { type: 'final' } } }); getSimplePaths(machine)['\"thanks\"'].paths.map((path) => { return path.map(({event}) => event.type) })
Loading…

no comments

    sign in to comment