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

Ability to add call-level parameters to hooks #303

Open
guillaumemach opened this issue Oct 10, 2023 · 1 comment
Open

Ability to add call-level parameters to hooks #303

guillaumemach opened this issue Oct 10, 2023 · 1 comment

Comments

@guillaumemach
Copy link

Hi all,

I've been using this package for some time, Thanks for this very good work.

There are situations where I need to call a hook (let say the after.insert hook for this example, but it could be any of them), but I don't want to perform all the actions define in the hook. So far to do this conditional computation in the hook it seems I can only rely on the document passed.

What I would need is to be able to pass extra arguments to the insert/update/remove/upsert call, which I can use inside the hook to perform computation or not based on these.

For exemple something like :
MyCollection.insert({}).callOptions({denormalize: false});

And then

MyCollection.after.insert(function(userId, doc, {denormalize}){
     if(denormalize) ...
})

So:

  • Is there a way to do this from current version ?
  • If no would it be possible to add such feature ?

Thanks a lot !

@github-actions
Copy link

Thank you for submitting this issue!

We, the Members of Meteor Community Packages take every issue seriously.
Our goal is to provide long-term lifecycles for packages and keep up
with the newest changes in Meteor and the overall NodeJs/JavaScript ecosystem.

However, we contribute to these packages mostly in our free time.
Therefore, we can't guarantee you issues to be solved within certain time.

If you think this issue is trivial to solve, don't hesitate to submit
a pull request, too! We will accompany you in the process with reviews and hints
on how to get development set up.

Please also consider sponsoring the maintainers of the package.
If you don't know who is currently maintaining this package, just leave a comment
and we'll let you know.

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

1 participant