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

Declare functions dynamically. #1

Closed

Conversation

jeremenichelli
Copy link

Isn't it more future proof and shorter if you declare the types in a strings array and bind the functions inside a for loop to avoid writing the same function over and over?

@toddmotto
Copy link
Owner

I did think about doing something like this, so thanks man - looks awesome. One thing I'd say is .bind() would be better off being replaced with this so it works in all browsers:

var bind = function (fn, context) {
  return function () {
    return fn.apply(context, arguments);
  };
};

@jeremenichelli
Copy link
Author

True that, I'll update the PR later, thanks.

@jeremenichelli jeremenichelli changed the title Declare functions dinamically. Declare functions dynamically. Jun 4, 2014
@toddmotto
Copy link
Owner

Going to merge bits manually as making some other changes! :) thanks man.

@toddmotto toddmotto closed this Jun 4, 2014
@jeremenichelli
Copy link
Author

No problem man, go for it 😃

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

Successfully merging this pull request may close these issues.

2 participants