I love the name.
Allora – Use promises on any JavaScript object
11–20 of 25 posts
Re: Allora – Use promises on any JavaScript object
#12Earlier quoted context omitted.
The point is to take APIs that don't and wrap them with said classes, not to provide an alternative.
What percentage of browsers in use implement Proxy and Promise classes? 40 percent?
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.
Re: Allora – Use promises on any JavaScript object
#13Earlier quoted context omitted.
What percentage of browsers in use implement Proxy and Promise classes? 40 percent?
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/
On https://www.netmarketshare.com combined IE market share is 31% and Edge is 5%.
Re: Allora – Use promises on any JavaScript object
#14It is not possible to fulfill promise more than once. Thus promisifying of window.setInterval() and window.requestAnimationFrame() is very questionable. The same applies to possibly repeatable .onXXXX() methods. 2.2.2 If onFulfilled is a function: ... 2.2.2.3 it must not be called more than once. https://promisesaplus.com/
Re: Allora – Use promises on any JavaScript object
#15It is not possible to fulfill promise more than once. Thus promisifying of window.setInterval() and window.requestAnimationFrame() is very questionable. The same applies to possibly repeatable .onXXXX() methods. 2.2.2 If onFulfilled is a function: ... 2.2.2.3 it must not be called more than once. https://promisesaplus.com/
requestAnimationFrame doesn't repeat, it only triggers the function once, you have to request an animation frame on each render to have it run again. Valid point however regarding the other things. Might be a neat api to have like a generator for these kinds of things, something like: for click in window.document.body: // do something with click and then stick this in an async function?
Re: Allora – Use promises on any JavaScript object
#16Earlier quoted context omitted.
It's not possible to fulfill a promise more than once, no. But a Promise.all method, while outside the A+ spec, conventionally returns a promise for the resolution of all promises in the array passed as an argument; if all those promises are fulfilled, so will be the promise returned by .all, while if any of them is rejected, so will be the etc., etc. So the browser example given in the Allora Github readme is perfec…
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?
Re: Allora – Use promises on any JavaScript object
#17Cool but what was wrong with all of the other modules that do this? There are like 30 of them. https://npms.io/search?term=Promisify
Re: Allora – Use promises on any JavaScript object
#18Re: Allora – Use promises on any JavaScript object
#19Earlier quoted context omitted.
What percentage of browsers in use implement Proxy and Promise classes? 40 percent?
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/