Meteor Timers - Meteor

What is the use of Timers in Meteor?

Meteor provides its own setTimeout and setInterval methods and these methods are used to make sure that all global variables have correct values. They work like regular JavaScript setTimout and setInterval.


This is Meteor.setTimeout example.

Timeout function is called in the console once the app has started.



Next example is showing how to set and clear interval.


We will set the initial counter variable which will be updated after every interval call.


Console will log the updated counter variable every three seconds. This can be stopped by clicking CLEAR button and this will call clearInterval method.


All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Meteor Topics