3 ms·
So what does this thatWindow.setInterval(100).then( foo ) mean exactly? How many times the foo() will be called? And how to stop that interval?
by c-smile 10y ago
So what does this
thatWindow.setInterval(100).then( foo )
mean exactly? How many times the foo() will be called? And how to stop that interval?
- gianlucaguarini 10y agofoo will be called only once (see my answer above). I am working on another script to achieve event streams using es6 generators let's keep in touch
- egeozcan 10y agopromisifiedWindow.setInterval(200).then(x => console.log("res:", x)); -> Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} >> VM310:1 res: undefined How do you cancel the interval?
- gianlucaguarini 10y agoAt moment it's not possible and it does not make any sense to use a setInterval with a promise in return. But I will think about a simple solution to clear the timer functions
- gianlucaguarini 10y agoOk with this it should be possible https://github.com/GianlucaGuarini/allora/pull/3 https://github.com/GianlucaGuarini/allora/pull/3