Skip to content
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

Example project? #2

Open
GeoffreyBooth opened this issue May 10, 2015 · 6 comments
Open

Example project? #2

GeoffreyBooth opened this issue May 10, 2015 · 6 comments

Comments

@GeoffreyBooth
Copy link

Would you mind please posting an example project that shows how to use this with browserify? How would I connect a server-side database, accessed via Ajax say, with a Meteor collection or minimongo?

@wzalazar
Copy link

Great job, can you create one example how to use de project? thank you!

@afaur
Copy link

afaur commented Sep 23, 2015

@GeoffreyBooth and @wzalazar

The minimongo functionality can be located in https://github.com/eface2face/meteor-observe-sequence/blob/master/observe_sequence.js#L11

You could connect to a rest/json endpoint and then write the data into the LocalCollection that you instantiate in your own client code. This should allow you to read and write client side data.

If you don't need the ability to query the data in a mongoish way on client you could probably just create a ReactiveVar with an object and inject it into template. Anytime you update it in javascript it would force any templates that you used it in to recompile and re-render.

If you are trying to use a meteor collection server-side to populate and sync the LocalCollection then you might have trouble. This project from my understanding currently does not include any of the pub/sub DDP client code.

Some of that logic might be in the meteor source around here: https://github.com/meteor/meteor/blob/devel/packages/ddp-client/livedata_connection.js#L1357
The documentation says that particular method is faking it, but basically DDP over websockets seems to be responsible for this.

Hopefully that helps a little, I think an example would be good. If that's something your still interested in seeing without the DDP portion then let me know and I will try to work on an example.

@emmanuelbuah
Copy link

I'd also like to know how to use browserify to include this library clientside.

@ibc
Copy link

ibc commented Nov 8, 2015

Just read the browserify doc.

@emmanuelbuah
Copy link

No worries. I figured it out. Pretty easy. @ibc any idea how to compile blaze templates client-side using meteor-client?

@afaur
Copy link

afaur commented Nov 9, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants