Created
July 12, 2017 13:29
-
-
Save filipenevola/5049700c999edee9160ee02ec1e6c050 to your computer and use it in GitHub Desktop.
timer without template scope
This file contains hidden or 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
| 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