Skip to content

Instantly share code, notes, and snippets.

@justinhj
Last active December 18, 2019 05:05
Show Gist options
  • Save justinhj/2093332e7d1ca44a1da25bf10efe1bad to your computer and use it in GitHub Desktop.
Save justinhj/2093332e7d1ca44a1da25bf10efe1bad to your computer and use it in GitHub Desktop.
.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