You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because the Router's add function is Handler<Params> and not Handler<P extends Params = Params>, this prevents people from adding handlers to the Router.add function that implement a type P that extends Params
Argument of type'Handler<VerifyParams>' is not assignable to parameter of type'Handler<Params>'.
Type 'Params' is missing the following properties from type'VerifyParams': address, anotherParam
The text was updated successfully, but these errors were encountered:
Problem
I want to have strong typing but currently the
Router
class'add
function has a signature like so:The problem is that handler has a signature like so:
Because the Router's
add
function isHandler<Params>
and notHandler<P extends Params = Params>
, this prevents people from adding handlers to the Router.add function that implement a type P that extends ParamsSolution
would be nice to change to something like
Context
The reason why is because atm when I do something like
this throws the error
The text was updated successfully, but these errors were encountered: