Created
June 24, 2015 13:25
-
-
Save gregoryyoung/a3e69ed58ae066b91f1b to your computer and use it in GitHub Desktop.
Event Sourcing as 3 functions.
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
f(events) -> state | |
match f(state, event) -> state | |
f(state, command) -> events |
Sounds sensible.
Given a state and a event, produce a new state
match is how you progress through the collection of events - f(events)
@kijanawoodard yes.
in some systems it may even be more complex than just match by type (see erlang/haskell)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm guessing it's "figure out which ones of
events
apply tostate
, then apply it."