Created
April 28, 2018 05:04
-
-
Save davich/f037a63222d79cd68ddb3a35f130d8f2 to your computer and use it in GitHub Desktop.
Sad path programming using Elixir's 'with' command
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
def handle_event(persisted_event) do | |
with :not_handled <- ActionFramework.handle_event(persisted_event), | |
:not_handled <- Action.handle_event(persisted_event), | |
:not_handled <- Comment.handle_event(persisted_event) do | |
:error | |
else | |
_ -> :ok | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment