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

Use a faster Function.prototype.bind utility function #1762

Closed
ngokevin opened this issue Aug 10, 2016 · 0 comments
Closed

Use a faster Function.prototype.bind utility function #1762

ngokevin opened this issue Aug 10, 2016 · 0 comments

Comments

@ngokevin
Copy link
Member

Description:

Bind is slow. The answer says that the native one does a lot of unnecessary stuff when we just want:

function bind(fn, ctx) {
    return function bound() {
        return fn.apply(ctx, arguments);
    };
}

I'd probably put this in src/utils/function.js so it is resistant to future possible namespacing. And then replace all our calls of bind with the new faster bind

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

No branches or pull requests

1 participant