Last active
February 26, 2018 23:06
-
-
Save StoneCypher/080a60476a7dfdf15ea28df71c31eaf6 to your computer and use it in GitHub Desktop.
Raganwald's example from http://raganwald.com/2018/02/23/forde.html
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
machine_name: "Raganwald's example"; | |
machine_source: http://raganwald.com/2018/02/23/forde.html ; | |
start_states: open; | |
initial_data: { balance: 0 }; | |
open 'deposit' { onfollow: `${(action, data) => ((data.balance += action.amount), data)}`; } -> open; | |
open 'withdraw' { onfollow: `${(action, data) => ((data.balance -= action.amount), data)}`; } -> open; | |
open 'place_hold' -> hold 'remove_hold' -> open; | |
[open hold] 'close' { onfollow: `${...}`; } -> closed; | |
close 'reopen' -> open; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment