Skip to content

Bind methods #49

@tarikjn

Description

@tarikjn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions