Skip to content

Instantly share code, notes, and snippets.

@gregoryyoung
Created January 20, 2019 19:33
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 gregoryyoung/e7ea27292b83f48109b6b29c78bcb6f0 to your computer and use it in GitHub Desktop.
Save gregoryyoung/e7ea27292b83f48109b6b29c78bcb6f0 to your computer and use it in GitHub Desktop.
new FSMDefinition<State>().CompletesWith<Completed>().
InState(State.Initial).With((state, x) => {
//dosomething
return State.Middle;
}).
InState(State.Middle).With((state, x) => {
//do something else
Send(new NextMessage(...));
return State.Ending;
}).
InState(State.Ending).With((state, x) => {
//ending
Send(new Completed(...));
return State.Completed;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment