question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`toEventHandler` changes handler shape

See original GitHub issue

When calling toEventHandler with an event handler function

toEventHandler((event) => {
})

It is expected that the first argument receives as H2Event. But in this case the shape of handler changes and first argument receives as IncommingMessage.

This is related to https://github.com/unjs/h3/blob/0692656c59074c3900b92b203151590f4ab8e055/src/event.ts#L88-L90

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
pi0commented, May 4, 2022

This needed a slighly breaking change from nitro to make usage of eventHandler same as cachedEventHandler. https://github.com/unjs/nitro/commit/7e72b8f327fb0141bce32d2b0b50e357ec6a7a07

1reaction
pi0commented, May 4, 2022

Nice naming BTW for legacy interface H2Event (vs H3Event) 😄

Read more comments on GitHub >

github_iconTop Results From Across the Web

Click Event Handler: How to change shape type on click
I have another event handler that will do the reverse, Circle to Square. The problem I'm having is since the circle-shaped isn't created...
Read more >
Event Handlers Propagate Changes Outside the Model
Learn that in the Visualization and Modeling SDK, you can define store event handlers to propagate changes to resources outside the store.
Read more >
Handling JavaFX Events: Working with Event Handlers
This topic describes event handlers in JavaFX applications. Learn how event handlers can be used to process the events generated by keyboard actions,...
Read more >
Creating Selection Change Event Handlers
You can create custom functions to handle selection change events in a graphics WINDOW or in a WIDGET_WINDOW. These functions must use the...
Read more >
Event Handler Properties Change on Shape Ignored? · Issue #65
I hit a problem where subsequent render iterations on a Shape with a key in a collection didn't modify the property. The original...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found