Live data from Hacker News

Allora – Use promises on any JavaScript object

github.com

21–25 of 25 posts

Re: Allora – Use promises on any JavaScript object

#21
post #10

Earlier quoted context omitted.

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?

foo 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

    promisifiedWindow.setInterval(200).then(x => console.log("res:", x));
    -> Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined}
    >> VM310:1 res: undefined
How do you cancel the interval?

Re: Allora – Use promises on any JavaScript object

#23

Earlier quoted context omitted.

foo 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

promisifiedWindow.setInterval(200).then(x => console.log("res:", x)); -> Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} >> VM310:1 res: undefined How do you cancel the interval?

At 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

Re: Allora – Use promises on any JavaScript object

#24

Earlier quoted context omitted.

foo 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

promisifiedWindow.setInterval(200).then(x => console.log("res:", x)); -> Promise {[[PromiseStatus]]: "pending", [[PromiseValue]]: undefined} >> VM310:1 res: undefined How do you cancel the interval?

Ok with this it should be possible https://github.com/GianlucaGuarini/allora/pull/3

Re: Allora – Use promises on any JavaScript object

#25

Earlier quoted context omitted.

Per Can I Use [1], promises are in 74% of browsers (only current major browser not supporting them is IE11) and proxies are in 57% of browsers. Promise is pretty easily polyfilled for older browsers; proxies are more problematic and I don't know whether or not any of the existing proxy polyfills will work with Allora. [1] http://caniuse.com/

What about IE8-10? I agree with pythonistah, that can-i-use data doesn't really map to real-world usage.

Perhaps they only collect data from browsers hitting their web site?
Post reply on HN