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

around for Actions #228

Closed
alitsiya opened this issue Dec 15, 2021 · 3 comments
Closed

around for Actions #228

alitsiya opened this issue Dec 15, 2021 · 3 comments

Comments

@alitsiya
Copy link
Contributor

I have a code with legacy interactor library (library haven't been updated since Dec. 2019) that I want to convert to a light-service actions. But there is an important piece is missing. Interactor allows you to have an around hook for a single service object vs LightService has around_each hook on Organizer, but not on a single Action.

I can customize Action inside my app and add around to MyBaseAction like this:

class MyBaseAction
  extend ::LightService::Action
  include MyHooks

 around :set_data_dog_traces

end

But was wondering if you would consider having around hook for a single Action.

@adomokos
Copy link
Owner

Hello @alitsiya!

When we added the around_each Organizer function, we believed that Actions should not be called individually, they should be part of an Organizer. In fact, I don't recall ever creating a single-action Organizer, I always started with two actions.

Is your convention different?

You could throw the action in an Organizer and just invoke it that way. Would that work for you?

@alitsiya
Copy link
Contributor Author

Thank you @adomokos ! Fair enough, also it would be a duplication of around_aech. Happy Holidays! Hope to contribute next year!

@adomokos
Copy link
Owner

Thanks, @alitsiya, same to you! 💯

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

No branches or pull requests

2 participants