Comments (4)
Looks to me like some good reasons are:
A. Avoid bloat - when isn't just a future/promise library. If you don't need 95% of the stuff in when, then there's no reason to bloat your web packages.
B. Simpler API - for similar reasons to the above
C. Looks like asyncFuture matches try-catch-finally semantics a little closer than when does, for example, in asyncFuture finally always passes through the resolution of the calling future, while in 'when' there is no way to propogate the value of the calling future (that's pretty bad design if you ask me).
D. Also, I see no straightforward way to resolve futures manually with 'when'. This is frequently necessary.
E. asyncFuture requires that you return a future from then
, catch
, and finally
blocks, because of the edge case where you want to return a future of a future. You shouldn't have to know what kind of value you have to be able to propogate it in a future chain.
Then again, 'when' supports non ES5 environments, whereas asyncFuture doesn't at the moment.
from asyncfuture.
@sompylasar Just added a performance comparison, and it turns out async-future is pretty much the fastest promise library! I'm pretty surprised actually, but it sure feels good : ) . When.js is also one of the fastest, and of course benchmarks have to be taken with a grain of salt, but its another minor reason to use it over when. Unless you're using IE. When.js seems to be slightly faster in IE11 for some reason.
from asyncfuture.
from asyncfuture.
I think the only thing i'm missing there is full test coverage for a wide set of browsers. Would definitely appreciate any help on that front. Thanks for the interest
from asyncfuture.
Related Issues (2)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from asyncfuture.