Skip to content

Instantly share code, notes, and snippets.

@yazeedb
Created November 24, 2019 02:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yazeedb/627c397a9646a368a2c429692c46e544 to your computer and use it in GitHub Desktop.
Save yazeedb/627c397a9646a368a2c429692c46e544 to your computer and use it in GitHub Desktop.
Generated by XState Viz: https://xstate.js.org/viz
const m = Machine({
"id": "notification",
"initial": "closed",
"context": {
"message": "",
"notificationType": "info"
},
"states": {
"closed": {},
"opened": {
"on": {
"CLOSE": "closed",
"PAUSE": "paused"
},
"after": {
"1500": "closed"
}
},
"paused": {
"on": {
"RESUME": "opened",
"CLOSE": "closed"
}
}
},
"on": {
"OPEN": {
"target": "opened",
"actions": {
"type": "xstate.assign",
"assignment": {}
}
}
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment