Skip to content

Very basic event handling#10

Open
loranallensmith wants to merge 3 commits intodevfrom
event-handling
Open

Very basic event handling#10
loranallensmith wants to merge 3 commits intodevfrom
event-handling

Conversation

@loranallensmith
Copy link
Copy Markdown
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