Skip to content

Instantly share code, notes, and snippets.

@spencercarli
Created February 12, 2016 02:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save spencercarli/a282972aa382d50ed889 to your computer and use it in GitHub Desktop.
Save spencercarli/a282972aa382d50ed889 to your computer and use it in GitHub Desktop.
Easily Connect React Native to a Meteor Server - Add Functionality to the Meteor App - home.js
Template.home.onCreated(function() {
this.subscribe('posts');
});
Template.home.helpers({
count() {
return Posts.find().count();
}
});
Template.home.events({
'click #increment': function(e) {
e.preventDefault();
Meteor.call('addPost');
},
'click #decrement': function(e) {
e.preventDefault();
Meteor.call('deletePost');
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment