Created
February 12, 2016 02:06
-
-
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
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
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