Skip to content

Instantly share code, notes, and snippets.

@spencercarli
Created February 12, 2016 02:05
Show Gist options
  • Save spencercarli/06bae07f7e753d2870e6 to your computer and use it in GitHub Desktop.
Save spencercarli/06bae07f7e753d2870e6 to your computer and use it in GitHub Desktop.
Easily Connect React Native to a Meteor Server - Add Functionality to the Meteor App - app.js
Meteor.startup(function() {
if (Posts.find().count() === 0) {
for (i = 1; i <= 10; i++) {
Posts.insert({title: 'Post ' + Random.id()});
}
}
});
Meteor.publish('posts', function() {
return Posts.find();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment