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

Very basic event handling #10

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Very basic event handling #10

wants to merge 3 commits into from

Conversation

loranallensmith
Copy link
Owner

This PR is an initial pass at getting event-handling up and running for all components. This approach feels inefficient to me because there is so much duplicated code, so I am definitely open to other solutions here. 🙇

The BrightwheelComponent superclass contains empty methods to make it easier for folks to extend component functionality without having to figure out whether or not a component supports a particular event. This means all components will theoretically support calls to all DOM events that Etch supports. This isn't necessarily practical since not all calls make sense on all types of components though.

One next step we could take would be to remove superfluous event handlers from components where they don't make sense. An additional step would be to move the catch-all event-handling methods out of the superclass and into the individual component classes themselves. I'm not sure what kind of headaches that could create down the road.

Long term, I think it also makes sense to break some of these components apart a bit more. For instance, the Table component is monolithic at the moment. Breaking it apart into smaller components would allow us to offer more granular event handling.

Steps before merging

  • Update documentation to include instructions for event handling
  • Decide on whether to keep superclass methods or move them to individual components

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.

1 participant