Skip to content

Instantly share code, notes, and snippets.

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

  • Save filipenevola/051e63af710a2b3fc371b50f655cf494 to your computer and use it in GitHub Desktop.

Select an option

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