timer-machine icon indicating copy to clipboard operation
timer-machine copied to clipboard

Is posible to keep the Timer names in an array?

Open leandroz opened this issue 11 years ago • 1 comments

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!

leandroz avatar Sep 23 '14 18:09 leandroz

I respond to myself:

Timer.get('someId').time()

leandroz avatar Sep 23 '14 19:09 leandroz