Skip to content

First pass on hooks. - #2

Merged
alanpeabody merged 2 commits into
masterfrom
add-hooks-and-transaction
May 3, 2016
Merged

alanpeabody merged 2 commits into
masterfrom
add-hooks-and-transaction

Conversation

@alanpeabody

Copy link
Copy Markdown
Contributor

Adds three callbacks and a transaction to perform lifecycle.

  • before_call/1 is called first and what ever it returns is passed to call.
  • call/1 is called next.
  • after_call/1 is called next, but before anything is implicitly executed.
  • Interactor.Handler.handle/2 protocol is called next, this is where changesets and multis are actually executed, and can be extended.
  • after_perform/1 is called last, after the multi or changeset is inserted. It can be used to format results or to fire off jobs or even call other interactors.

All above hooks are wrapped in a transaction.

@beerlington @totallymike Any feedback/thoughts on hooks?

@alanpeabody
alanpeabody merged commit a01d635 into master May 3, 2016
@alanpeabody
alanpeabody deleted the add-hooks-and-transaction branch May 3, 2016 22:51
@alanpeabody alanpeabody mentioned this pull request Nov 24, 2016
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant