Meteor-Community-Packages / meteor-collection-hooks

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

Integration with Collection2 #30

Closed ggmacasaet closed 10 years ago

ggmacasaet commented 10 years ago

I am trying to integrate collection hooks with Collection2 but i am getting the following error.

20140306-15:13:41.021(8)? (STDERR) Error: use "new" to construct a Meteor.Collection W20140306-15:13:41.022(8)? (STDERR) at new Meteor.Collection (packages/mongo-livedata/collection.js:7) W20140306-15:13:41.022(8)? (STDERR) at Meteor.Collection (packages/collection2/collection2.js:47) W20140306-15:13:41.022(8)? (STDERR) at collections/connections.coffee:1:19

darkship commented 10 years ago

I had the same problem.

I solved it through declaring collection-hooks before collection2 in my package.

ggmacasaet commented 10 years ago

Thanks for the quick response but I havn't declare any hooks yet. And my collections declaration are in common code. On Mar 6, 2014 6:59 PM, "darkship" notifications@github.com wrote:

I had the same problem.

I solved it through declaring collection-hooks before collection2 in my package.

Reply to this email directly or view it on GitHubhttps://github.com/matb33/meteor-collection-hooks/issues/30#issuecomment-36844773 .

mizzao commented 10 years ago

@ggmacasaet, @darkship is talking about the order in which packages are loaded, or declared in .meteor/packages if you are just putting both straight in your app. The way your code is organized doesn't change the package load order, so just make sure that collection-hooks is loaded first through either the packages file or the smart packages.

See also issue #24 by the creator of Collection2.