Last active
January 24, 2020 18:05
-
-
Save xentek/b311b0247bb13f7ea578d3f761ee4f66 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions | |
// - XState (all XState exports) | |
const contactMachine = Machine({ | |
id: 'contact', | |
initial: 'new', | |
states: { | |
"new": { | |
on: { | |
INVITE: 'invited' | |
} | |
}, | |
"import": { | |
on: { | |
INVITE: 'invited' | |
} | |
}, | |
"invited": { | |
on: { | |
CONFIRM: "awaitingActivation" | |
}, | |
}, | |
"awaitingActivation": { | |
on: { | |
CONFIRM: "active" | |
}, | |
}, | |
"denied": { | |
on: { | |
APPROVE: "approved", | |
HOLD: "onHold" | |
} | |
}, | |
"approved": { | |
on: { | |
PROCESS_APPROVAL: "awaitingActivation" | |
} | |
}, | |
"onHold": { | |
on: { | |
DENY: 'denied', | |
APPROVE: 'approved' | |
} | |
}, | |
active: { | |
on: { | |
DEACTIVATE: "inactive" | |
} | |
}, | |
inactive: { | |
on: { | |
DELETE: "deleted", | |
ACTIVATE: "active" | |
} | |
}, | |
pending: { | |
on: { | |
APPROVE: 'approved', | |
DENY: 'denied', | |
HOLD: 'onHold' | |
} | |
}, | |
deleted: { | |
type: "final" | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment