Skip to content

Instantly share code, notes, and snippets.

@filipenevola
Created July 12, 2017 13:29
Show Gist options
  • Select an option

  • Save filipenevola/5049700c999edee9160ee02ec1e6c050 to your computer and use it in GitHub Desktop.

Select an option

Save filipenevola/5049700c999edee9160ee02ec1e6c050 to your computer and use it in GitHub Desktop.
timer without template scope
const timer = new ReactiveVar(0);
Template.startTimer.events({
'click button'(event, instance) {
setInterval(() => {
timer.set(timer.get() + 1);
}, 1000);
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment