Hey, I'm Yehor! ๐
lvivski / davy Goto Github PK
View Code? Open in Web Editor NEWYet another Promises/A+ implementation optimized for speed and simplicity.
License: MIT License
Yet another Promises/A+ implementation optimized for speed and simplicity.
License: MIT License
Hey, I'm Yehor! ๐
Hi,
When calling Promise.all
with an array, it will try to resolve all promises using Promise.each
, calling it on the array and a resolve
function ( https://github.com/lvivski/davy/blob/master/src/extra.js#L68 ), assigning the result to a resolver
variable.
Problem is this resolver
variable is used inside the resolve
function ( https://github.com/lvivski/davy/blob/master/src/extra.js#L89 ), but it will still be undefined
since the call to Promise.each
is completed yet.
Isn't there something wrong here?
foo = new Davy
bar = new Davy
Is it possible to make a deferred that exectures when booth foo and bar is fulfilled with Davy?
thx!
DOM promises are in Chrome behind flag today.
But they are in. I propose to remove global.Promise = ...
as this will confuse libs that try to detect native promises.
I don't really know why, but after installing davy
using Bower and targeting the 0.3.0 version, I have the following code at line 157:
Promise.reject = function(err) {
var resolver = new Resolver();
resolver.reject(err);
return resolve.promise;
};
Which does not match the source code for the 0.3.0 version, using Promise.defer()
rather than new Resolver()
. I don't why but it's problematic since it does not work (because it creates a Resolver with no this.promise and when trying to reject it, it fails)...
Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.