Skip to content

Commit

Permalink
allow optional parameters for createEventDispatcher
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanhofer committed Feb 4, 2022
1 parent c17384b commit 22aa51d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/runtime/internal/lifecycle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ type ExtractObjectValues<Object extends Record<any, any>> = Object[keyof Object]
type ConstructDispatchFunction<EventMap extends Record<string, any>, EventKey extends keyof EventMap> =
EventMap[EventKey] extends never
? (type: EventKey) => void
: undefined extends EventMap[EventKey]
? (type: EventKey, detail?: EventMap[EventKey]) => void
: (type: EventKey, detail: EventMap[EventKey]) => void

type CreateDispatchFunctionMap<EventMap> = {
Expand Down

0 comments on commit 22aa51d

Please sign in to comment.