Last active
January 17, 2020 14:30
-
-
Save llldc21/ac414227a35546b3f63257d14fafcefa 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
const promiseMachine = Machine({ | |
id: 'promise', | |
initial: 'draft', | |
states: { | |
draft: { | |
on: { | |
READY: 'resolved', | |
DELETED: 'rejected' | |
} | |
}, | |
resolved: { | |
on: { | |
CANCELED: 'canceled', | |
WAITING: 'waiting' | |
} | |
}, | |
rejected: { | |
type: 'final' | |
}, | |
waiting: { | |
on: { | |
REFUSED: 'refused', | |
CANCELED: 'canceled', | |
ACCEPTED: 'accepted' | |
} | |
}, | |
canceled: { | |
type: 'final' | |
}, | |
refused: { | |
type: 'final' | |
}, | |
accepted: { | |
on: { | |
RESOLVED: 'resolved', | |
WAITING: 'waiting' | |
} | |
} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment