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

event decorator for components #113

Closed
2 tasks
Tracked by #64
muratcorlu opened this issue May 19, 2022 · 0 comments · Fixed by #115
Closed
2 tasks
Tracked by #64

event decorator for components #113

muratcorlu opened this issue May 19, 2022 · 0 comments · Fixed by #115
Assignees
Milestone

Comments

@muratcorlu
Copy link
Contributor

Lit doesn't provide any convention for defining and publishing component events but it seems logical to at least create our own. So events of the component will be more visible and we'll avoid code duplication for firing multiple events from many components.

class GrIcon extends LitElement {
   ....
   @event('gr-load') load: EventEmitter<string>;

So for me, requirements are:

  • A common function/class to fire type-safe component events with optional parameters (bubbles, cancellable).
  • A decorator that accepts optional event name. By default it can use kebab-cased version of the class property name.
@muratcorlu muratcorlu added this to the v2.0 milestone May 19, 2022
@muratcorlu muratcorlu self-assigned this May 19, 2022
@muratcorlu muratcorlu linked a pull request May 20, 2022 that will close this issue
@muratcorlu muratcorlu mentioned this issue Jul 1, 2022
64 tasks
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