Skip deferred callbacks for skipped Interactors#8
Merged
mjonas87 merged 1 commit intoforked-mainfrom Apr 1, 2024
Merged
Conversation
…skipped Previously, if a deferred Interactor had a conditional (ie; if or unless) attached to it, it's deferred after_perform callbacks were NOT skipped. This is because when using deferment...an Organizer assumes responsibility for executing the after_perform callbacks. When I implemented the Organizer logic that runs the deferred after_perform callbacks, I failed to account for conditionals. This commit passes the calling Organizer in with the call to execute the deferred after_perform callbacks. This is used to check the conditional and see if the callback should be run or skipped. Now, if an Interactor is skipped, it's deferred after_perform callbacks will be too.
ecb74a4 to
7d2e4a6
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
In an Organizer, skip an Interactor's callbacks if the Interactor is skipped
Previously, if a deferred Interactor had a conditional (ie; if or unless) attached to it, it's deferred after_perform callbacks were NOT skipped. This is because when using deferment...an Organizer assumes responsibility for executing the after_perform callbacks. When I implemented the Organizer logic that runs the deferred after_perform callbacks, I failed to account for conditionals.
This commit passes the calling Organizer in with the call to execute the deferred after_perform callbacks. This is used to check the conditional and see if the callback should be run or skipped. Now, if an Interactor is skipped, it's deferred after_perform callbacks will be too.
Information
[ ] Contains Documentation[ ] Contains Breaking Changes