Skip to content

Instantly share code, notes, and snippets.

@feymartynov
Created November 24, 2018 00:57
Show Gist options
  • Save feymartynov/b586697dab0fd43b5f1fcbcedb6b79b9 to your computer and use it in GitHub Desktop.
Save feymartynov/b586697dab0fd43b5f1fcbcedb6b79b9 to your computer and use it in GitHub Desktop.
ExOperation article: defer example
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