Last active
August 12, 2019 11:58
-
-
Save briandipalma/d23c4b82f3f90807cf9ef88c7d53595d 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 blockTradesMachine = Machine({ | |
id: 'BlockTrades', | |
initial: 'Initial', | |
states: { | |
Initial: { | |
on: { | |
Submit: "Submitted" | |
} | |
}, | |
Submitted: { | |
on: { | |
ClientClose: "ClientCloseSent", | |
SumbitAck: "Queued" | |
} | |
}, | |
Queued: { | |
on: { | |
ClientClose: "ClientCloseSent", | |
Expire: "Expired", | |
PickUp: "PickedUp" | |
} | |
}, | |
ClientCloseSent: { | |
on: { | |
ClientCloseAck: "ClientClosed" | |
} | |
}, | |
PickedUp: { | |
on: { | |
Hold: "Queued", | |
PriceUpdate: "Executable", | |
ClientClose: "ClientCloseSent" | |
} | |
}, | |
Executable: { | |
on: { | |
Withdraw: "PickedUp", | |
PriceUpdate: "Executable", | |
Expire: "Expired", | |
Execute: "ExecuteSent", | |
ClientClose: "ClientCloseSent" | |
} | |
}, | |
ExecuteSent: { | |
on: { | |
PriceUpdate: "ExecuteSent", | |
ExecuteAck: "Executed", | |
Warning: "WarningSent" | |
} | |
}, | |
WarningSent: { | |
on: { | |
RejectWarning: "Executable", | |
AcceptWarning: "AcceptWarningSent", | |
ClientClose: "ClientCloseSent" | |
} | |
}, | |
AcceptWarningSent: { | |
on: { | |
AcceptWarningAck: "Executed" | |
} | |
}, | |
Executed: { | |
on: { | |
Expire: "Expired", | |
TradeConfirmation: "TradeConfirmed" | |
} | |
}, | |
ClientClosed: {type: "final"}, | |
TradeConfirmed: {type: "final"}, | |
Expired: {type: "final"} | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment