Created
February 12, 2016 02:05
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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