Skip to content

DEMO: Action helper. No more data-user-id needed.#104

Open
smfoote wants to merge 1 commit intomasterfrom
action-helper
Open

DEMO: Action helper. No more data-user-id needed.#104
smfoote wants to merge 1 commit intomasterfrom
action-helper

Conversation

@smfoote
Copy link
Owner

@smfoote smfoote commented Jul 17, 2015

Because the listener has the context/model within closure scope, no need to do model lookups when the event happens.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if this would be useless, but maybe you could allow binding to a different context:

let boundContext = params.context || context;
frag.querySelector(selector).addEventListener(type, context[method].bind(boundContext));

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