Last active
December 18, 2019 05:05
-
-
Save justinhj/2093332e7d1ca44a1da25bf10efe1bad to your computer and use it in GitHub Desktop.
This file contains hidden or 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
.onEvent { | |
case (WithdrawEvt(time, description, amount), state) => | |
AccountState(state.balance - amount) | |
case (DepositEvt(time, description, amount), state) => | |
AccountState(state.balance + amount) | |
case (AssignAccountHolderEvt(time, accountHolder), state) => | |
Account(state.balance, Some(accountHolder)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment