Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add support for promising at organizer level #1

Merged
merged 23 commits into from
Dec 27, 2023
Merged

add support for promising at organizer level #1

merged 23 commits into from
Dec 27, 2023

Conversation

markburns
Copy link
Owner

@markburns markburns commented Dec 26, 2023

Adds support for

class SomeOrganizer
  include Interactify

  organize \
    DoStep1.promising(:step_1),
    DoStep2.promising(:step_2)

Example failure at load time

SomeOrganizer::DoStep1 does not promise:
step_1

Actual promises are:
step1

These calls to promising return the receiver. I.e. DoStep1 and DoStep2 in the example above, but also verify that the promises specified in the arguments :step_1 and :step_2 respectively, match the promises defined in each interactor.

Why add this?

It's for the reader of the code in the future.
By explicitly calling out the promises, it's easier to debug where something is added in a chain.
By also verifying at load time, we ensure that the promising calls do not drift from the interactor promises implementation, as they raise an exception.

I.e. this is enforced executable documentation.

@markburns markburns merged commit 38f57b9 into main Dec 27, 2023
1 check passed
@markburns markburns deleted the promising branch December 27, 2023 08:38
@markburns markburns mentioned this pull request Dec 27, 2023
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.

None yet

1 participant