Closed atscott closed 1 year ago
Having the handler a Promise<undefined> makes it a little awkward to implement, requiring an explicit return undefined at times.
Promise<undefined>
return undefined
Promise<void> allows for omitting an explicit return when using an async function.
Promise<void>
Example
I believe info should be optional on the NavigateEvent given that it is optional in the NavigateEventInit and my experimentation revealed that it is indeed undefined if not set in the NavigationNavigateOptions.
info
NavigateEvent
NavigateEventInit
undefined
NavigationNavigateOptions
Commit 1:
refactor(types): NavigationInterceptOptions handler should return Promise
Having the handler a
Promise<undefined>
makes it a little awkward to implement, requiring an explicitreturn undefined
at times.Promise<void>
allows for omitting an explicit return when using an async function.Example
Commit 2
fix(types): Make info optional on NavigateEvent
I believe
info
should be optional on theNavigateEvent
given that it is optional in theNavigateEventInit
and my experimentation revealed that it is indeedundefined
if not set in theNavigationNavigateOptions
.