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

fix(types): improve e.detail type for dispatched events #1907

Merged
merged 3 commits into from
Feb 1, 2024

Conversation

metonym
Copy link
Collaborator

@metonym metonym commented Jan 27, 2024

Some dispatched events do not have an explicit type annotation, and thus default to CustomEvent<any>.

This PR enhances the DX by explicitly annotating the type.

<Slider
  on:change="{(e) => {
    console.log(e.detail); // number
  }}"
/>

Copy link
Collaborator

@theetrain theetrain left a comment

Choose a reason for hiding this comment

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

Looks good, and works well!

@theetrain theetrain merged commit 6590457 into master Feb 1, 2024
3 checks passed
@theetrain theetrain deleted the custom-event-detail-type branch February 1, 2024 15:56
@metonym
Copy link
Collaborator Author

metonym commented Feb 7, 2024

Fixed in v0.82.9

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