Created
December 20, 2018 14:29
-
-
Save anagromataf/9ede3ff8470145bba566e51a0e827d20 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
def apply(action, state, args, store, ref, revision) do | |
with {:ok, transaction} <- action.prepare(state, args), | |
{:ok, transaction_ref} <- store.prepare(ref, revision, action, transaction), | |
{:ok, new_state, result} <- action.commit(state, transaction), | |
{:ok, revision} <- store.commit(ref, transaction_ref, new_state) do | |
{:ok, new_state, revision, result} | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment