-
Notifications
You must be signed in to change notification settings - Fork 101
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
Asteroid & Subscriptions #116
Comments
Hi @aadamsx, I'm not sure to have understood. To make query to mongo, you should have a specific publication on meteor server. The added event on asteroid return an object with the keys collection, fields and id and include the element added to collection and not the entire collection. You should save the collections somewhere in your application as plain JS object. If you want to save in another structure, you can make your own mixin (like the asteroid-immutable-collections-mixin which convert the collections in Immutable.js). |
Yes, done that
Yes, I've seen that, I get the following object for example:
OK, this is the part were I fell down. So save the object in a Session variable for example?
Thank you, I'll check this out. |
Yes, something like this. For example in React application we use the redux store to save the collections. |
Right, and in Blaze we use mini-mongo. So I played with this more, and it's going to be difficult doing anything with that return object, in part I guess because I don't have a redux store. What would be great is if I could do something like what we can do with a straight DDP connection, for example. This makes it so easy to get Collections in the proper format from the remote server! http://stackoverflow.com/a/18360441/2547360:
Notice how I can take the connection and pass it to the Meteor.Collection, and from there query it acts like mini-mongo on the client (with a .find())? Is there a way to do this in Asteroid? It seems there use to be some equivalent to this before with Asteroid: https://www.npmjs.com/package/asteroid.browser
But I can't find .getCollection() |
Hello guys! I have the exact same issue as @aadamsx . Were you able to solve it? |
Before switching to React or Vue, I'm trying out Blaze with Asteroid (since my existing code base is Blaze). Most all examples I see are Asteroid + React/Redux, where the contents of the Subscription are piped into the Redux store.
The only issue I see so far with Asteroid is, when using it with Blaze (as a test), I don't see a way to pipe in the subscription into mini-mongo.
For example, I inside the ddp.on('added' ...) I cannot do a People.findOne({userId: ID}), like I could with mini-mongo. So at least with Blaze, there seems to be no way to get the data out from the subscription...
I get an Object inside 'added' like so:
My question, is there a way to query the subscription like I do in mini-mongo?
The text was updated successfully, but these errors were encountered: