Created
June 5, 2015 22:10
-
-
Save Papipo/2589cf75c382802204e1 to your computer and use it in GitHub Desktop.
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
defp apply_events(events) do | |
Enum.reduce(events, %{}, fn(event, state) -> | |
apply_event(event.name, event.data, state) | |
end) | |
end |
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
defp apply_events(events) do | |
Enum.reduce(events, %{}, &apply_event/2) | |
end | |
defp apply_event(%Event{name: name, data: data}, state) do | |
apply_event(name, data, state) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment