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

Pull listeners block into base classes. #29

Closed
theengineear opened this issue May 7, 2019 · 0 comments · Fixed by #32
Closed

Pull listeners block into base classes. #29

theengineear opened this issue May 7, 2019 · 0 comments · Fixed by #32

Comments

@theengineear
Copy link
Collaborator

We've been playing with the notion of having a static listeners block akin to the properties block which will handle setup / teardown of listeners on connection / disconnection.

There are two important opinions that our listeners block has so far made:

  1. The target to attach listeners to is the shadowRoot.
  2. We will not support additional listeners args (e.g,. capture)

These simplifications have, thus far, been helpful. However, (1) is important because we may not have a shadowRoot in the future, in which case we have to decide if we just fallback to the element itself. It's also important because there are valid use-cases for listening on the host element, not the shadowRoot. For now, you'll just need to manually hook up these listeners using listen and unlisten.

Point (2) seems to be another edge case. Again, if you want to add additional args, the listen and unlisten methods provide for that.

theengineear added a commit that referenced this issue May 9, 2019
A new `listeners-mixin` exists which is meant to be more low-level than
the `properties-mixin`. It allows us to pull out some code that’s not
strictly needed for the `element-mixin`, which mostly wants to concern
itself with necessities for creating custom elements.

Closes #29
theengineear added a commit that referenced this issue May 10, 2019
A new `listeners-mixin` exists which is meant to be more low-level than
the `properties-mixin`. It allows us to pull out some code that’s not
strictly needed for the `element-mixin`, which mostly wants to concern
itself with necessities for creating custom elements.

Closes #29
theengineear added a commit that referenced this issue May 10, 2019
A new `listeners-mixin` exists which is meant to be more low-level than
the `properties-mixin`. It allows us to pull out some code that’s not
strictly needed for the `element-mixin`, which mostly wants to concern
itself with necessities for creating custom elements.

Closes #29
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 a pull request may close this issue.

1 participant