Meteor-Community-Packages / meteor-collection-hooks

Meteor Collection Hooks
https://atmospherejs.com/matb33/collection-hooks
MIT License
657 stars 92 forks source link

Multiple Collection.before.update() declarations #81

Closed evliu closed 9 years ago

evliu commented 9 years ago

I was wondering if there was a way to append more functions to be run on someCollection.before.update(myFunction). I'm writing a package to extend a framework that already declares a before.update action and I don't want to overwrite it, but add to it. Thanks!

matb33 commented 9 years ago

It's already like that by design. When calling before.update with a function, this function is pushed into an array that is later iterated over when the hook is executed.

evliu commented 9 years ago

awesome, thanks a lot!

cyclops24 commented 7 years ago

@evliu what about after.update? Can we use multiple after hook on a collection?

cyclops24 commented 7 years ago

@evliu My question related to this: https://github.com/matb33/meteor-collection-hooks/issues/205