Comments (8)
If anything, I think the right approach would be to integrate hooks into smart collections themselves rather than using the monkey-patching approach here. There are two reasons for this. First, they are not part of core, so using a top-to-bottom programming approach would be easier to push through. Second, it would further raise the benefits of smart collections so that core would really have to consider bringing them in along with the collection hooks.
Also, see https://groups.google.com/forum/#!topic/meteor-core/jG1KLObX1bM
from meteor-collection-hooks.
I looked through @arunoda's code quickly and it seems I might be able to plug some hooks into his infrastructure more easily than with core. Not 100% sure yet, was just a quick glance. Should be doable
from meteor-collection-hooks.
Arunoda will not make any more features for SC. I don't think this makes sense anymore. What you think ?
from meteor-collection-hooks.
Agreed
from meteor-collection-hooks.
Ah. Is Smart Collections going into core or something? cc @arunoda
from meteor-collection-hooks.
Nop. SmartCollections will not going into core. But smart collection's core feature oplog support will be come with Meteor 1.0
So SmartCollections can retire peacefully after that :)
I used it in production and some other people use it, since it's the only way we can scale meteor now. But SmartCollections have limitations and it's does not have full meteor feature set. So once 1.0 comes we all can safely move into that.
from meteor-collection-hooks.
Sort of related..
A lot of people are using collection2 so I wanted to share how I was working with both packages...
testCollectionBase = new Meteor.Collection("testCollection");
testCollectionBase.after.insert( function (userId, doc) {
console.log("This was inserted:");
console.log(doc);
});
testCollection = new Meteor.Collection2(testCollection, {
schema: {
name: {
type: String,
label: "Name"
}
}
});
Is there anything wrong with doing this?
If not maybe add it to the readme as I'm sure most people will be extending standard collections.
p.s. I'm new to github so hopefully this is a good place to post this.
from meteor-collection-hooks.
@craig-l you're approaching it correctly. Simply having you post this here may be enough for people to find. If people continue to be confused with how to have Collection2 interoperate with collection hooks, I'll consider a note
from meteor-collection-hooks.
Related Issues (20)
- More explanation of 0.9.0 breaking changes please HOT 5
- How i can extend ALL collections? HOT 6
- After fetch hook? HOT 3
- An after.update hook's modifier doesn't get a before.update's updated modifier
- Add GitHub actions for CI HOT 2
- Using direct still causes fetchPrevious behaviour on update method
- hook "remove" does not remove hook or removes wrong hook HOT 1
- bulk update didnt trigger after update hooks HOT 3
- attach hooks to raw collections HOT 3
- Meteor 2.6: after.insert callback does not contain correct document _id HOT 2
- problem after insert doc._id object HOT 4
- Support to Meteor 2.8 and Mongo async methods HOT 5
- After update hook does not use direct find HOT 2
- Async hooks run in parallel to the collection operation HOT 3
- Meteor 3.0 migration considerations HOT 1
- Ability to add call-level parameters to hooks HOT 1
- Core dump at Meteor 3.0 alpha 15: node: ../src/coroutine.cc:134: void* find_thread_id_key(void*): Assertion `thread_id_key != 0x7777' failed. HOT 2
- Calling Meteor.userAsync inside pub throws an error in meteor 3 beta HOT 3
- before hooks and async callbacks are not compliant with Meteor 3 promises HOT 4
- Throw in before.* should also cancel the operation HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meteor-collection-hooks.