Meteor-Community-Packages / meteor-collection-hooks

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

How do we apply a hook to all collections? #170

Closed trusktr closed 8 years ago

trusktr commented 8 years ago

Is it CollectionHooks.before.<hookName>(function() {...})?

crapthings commented 8 years ago

+1 how to do it ?

_.each([Meteor.users, Products, Posts, Items], function(collection) {
    collection.before.insert();
});
trusktr commented 8 years ago

@crapthings That definitely works. I also just looked and see this: https://github.com/matb33/meteor-collection-hooks/blob/master/collection-hooks.js#L10-L15

Looks like we can put stuff in the defaults property there.

trusktr commented 8 years ago

@matb33 ?

bilics commented 8 years ago

+1 - How can I do this ?

matb33 commented 8 years ago

Agreed this would be useful

matb33 commented 8 years ago

Duplicate of https://github.com/matb33/meteor-collection-hooks/issues/110