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

Bind methods #49

Open
tarikjn opened this issue Oct 7, 2016 · 2 comments
Open

Bind methods #49

tarikjn opened this issue Oct 7, 2016 · 2 comments

Comments

@tarikjn
Copy link

tarikjn commented Oct 7, 2016

Currently one cannot do:

const {gettext} = i18n
gettext('Hello, World.')

As this would return:

TypeError: Cannot read property 'call' of undefined

However it seem fairly important to be able to shorten notations for views/renders with a lot of strings and for clarity of context.

Would it make sense to add a property accessor that would return an object listing those method as bound vs. call? This would also allow destructuring to get the needed methods.

@SlexAxton
Copy link
Member

Seems reasonable. Would you be into PRing a solution to this with a test?

Thanks!

@Suhoy95
Copy link

Suhoy95 commented May 17, 2017

In my project i try do the similar thing. I create Jed object in intermediate module and export function are tied to the object.

This functions in library may be ok with simple project, but i think that bindings will be made in user's code to control state of Jed object explicitly.

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

3 participants