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

Prototype method, static method, decorator #2

Open
js-choi opened this issue Mar 30, 2022 · 2 comments
Open

Prototype method, static method, decorator #2

js-choi opened this issue Mar 30, 2022 · 2 comments
Labels
question Further information is requested

Comments

@js-choi
Copy link
Collaborator

js-choi commented Mar 30, 2022

Should memo be a prototype method, a static function, a function decorator, or multiple?

This depends most on whether memo will be mostly used on anonymous functions, named function declarations, and/or class methods.

.bind is a prototype method.

Underscore and Lodash (necessarily) use static functions.

Python’s lru_cache is a decorator, although we don’t have function decorators yet.

@zloirock
Copy link

I'm strictly for a prototype method for .bind consistency and simplicity of usage.

@nektro
Copy link

nektro commented May 4, 2024

I would also prefer a prototype method

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

No branches or pull requests

3 participants