Closed miracle9312 closed 6 years ago
Promise.resolve(x)
is intended to behave equivalently to new Promise((resolve, reject) => resolve(x))
, we've just got a bunch of performance tricks in our version that make use of implementation details.
thanks,I get it, and your considerations in details inspires me a lot !
Promise.resolve1 = function(value) { return new Promise(function(resolve, reject){ resolve(value); }) };
I have tested 3 cases like value={then:fn}, value=promise,value=''...;but I cannot find any differences between Promise.resolve1 with your Promise.resolve. could you please explain the differences for me. thx!