#override setInterval

2 messages · Page 1 of 1 (latest)

slim mural
#

Hi, i am using Typescript and i want to override the setInterval and setTimeout functions. I need it, because I have problem with graceful termination of the node process. I just need to collect the return value of setInterval and setTimeout, and when the process recieve kill i need to clear them. The problem is i am using types/nodes package also and it provides another definiton of the setInterval, so i really do not what types to use so it can compile

keen spindle
#

@slim mural i wouldn't suggest overriding build-in functions like that. instead you could create some wrapper functions to take care of managing the timer handles