Created
November 24, 2018 00:57
-
-
Save feymartynov/b586697dab0fd43b5f1fcbcedb6b79b9 to your computer and use it in GitHub Desktop.
ExOperation article: defer example
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
operation | |
|> step(:foo, &foo/1) | |
|> defer(fn op, txn -> | |
case txn.foo.some_property do | |
:one -> | |
op |> step(:bar, &bar/1) | |
:two -> | |
op |> step(:baz, &baz/1) | |
end | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment