timer-machine
timer-machine copied to clipboard
Is posible to keep the Timer names in an array?
Hi!! I have to create a new Timer in every POST request to a Node.js server a keep track of each one, because then i need to destroy a specific Timer.
The problem is that i need different names for each Timer, so i am doing:
var timers = [];
timers['someId'] = new Timer();
but then when i want to perform get, time or destroy methods on a particular timer is not working. For example doing Timer.destroy(travelTimes[travel._id]); destroy all the Timers instead of a particular timer.
Thanks!
I respond to myself:
Timer.get('someId').time()