Skip to content

Instantly share code, notes, and snippets.

@stevehebert
Last active August 23, 2021 17:10
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 stevehebert/57c3a51eac85f41a1047cd20648872d5 to your computer and use it in GitHub Desktop.
Save stevehebert/57c3a51eac85f41a1047cd20648872d5 to your computer and use it in GitHub Desktop.
Configuring the State Machine
p.Configure(Opened).
OnEntry(OnOrderOpened).
PermitReentry(AddItemToOrder).
Permit(Claim, Claimed).
Permit(Cancel, Canceled)
p.Configure(Claimed).
OnEntry(OnOrderClaimed).
PermitReentry(AddItemToOrder).
Permit(Deliver, Delivered).
Permit(Cancel, Canceled)
p.Configure(Cancelled).
OnEntry(OnCancel)
p.FilteredSideEffect(plinko.AfterTransition, RecordMeasurementsAndLogging)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment