Last active
November 16, 2020 09:15
-
-
Save dsebastien/6acc039df72d5b1a6f3da8427fdb5f9e to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
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 characters
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const fetchMachine = Machine({ | |
id: 'meetings', | |
initial: 'draft', | |
context: { | |
}, | |
states: { | |
draft: { | |
on: { | |
DELETE: 'deleted', | |
PLAN_WITH_INVITES: 'planned', | |
PLAN_WITHOUT_INVITES: 'planned', | |
START_WITHOUT_INVITES: 'ongoing', | |
} | |
}, | |
deleted: { | |
type: 'final' | |
}, | |
planned: { | |
on: { | |
CANCEL: 'cancelled', | |
START: 'ongoing' | |
} | |
}, | |
cancelled: { | |
type: 'final' | |
}, | |
ongoing: { | |
on: { | |
PAUSE: 'paused', | |
STOP: 'finished', | |
} | |
}, | |
paused: { | |
on: { | |
RESUME: 'ongoing', | |
STOP: 'finished', | |
} | |
}, | |
finished: { | |
on: { | |
APPROVE: 'approved' | |
} | |
}, | |
approved: { | |
type: 'final' | |
} | |
} | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment