Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider using Promise.prototype.then #54

Open
RangerMauve opened this issue Feb 23, 2015 · 4 comments
Open

Consider using Promise.prototype.then #54

RangerMauve opened this issue Feb 23, 2015 · 4 comments

Comments

@RangerMauve
Copy link

There's a blog post about how using Promise.then is supposedly even faster than .nextTick.

Given that we have stuff like io.js with Promise support and a lot of browser supporting it to, do you think it'd make sense to conditionally use this feature if it exists?

@ForbesLindesay
Copy link
Collaborator

We need to be a little careful with polyfills for Promise that use this library internally.

@RangerMauve
Copy link
Author

Yeah, there could be something like this code to check that the Promise implementation is indeed native:

if(typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1){
    // it's native
}

Shamelessly grabbed from Benjamin Gruenbaum

@vicb
Copy link

vicb commented May 6, 2015

FYI, there seems to be a bug in Firefox microtask scheduling using a resolved Promise, see https://bugzilla.mozilla.org/show_bug.cgi?id=1162013

@RubenVerborgh
Copy link

On Chrome, Promise does not seem be faster than MutationObserver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants