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
Argument of type '(value: MyEvent) => void' is not assignable to parameter of type '(value: unknown) => void | Promise<void>'.
Types of parameters 'value' and 'value' are incompatible.
Type 'unknown' is not assignable to type 'MyEvent'.
Which makes usage quite user hostile. For consumption of APIs where the value could be anything, it is better to use the top type any, which is what occurs in several instances in built in types where the value could be of any type.
The text was updated successfully, but these errors were encountered:
kitsonk
added a commit
to kitsonk/deno
that referenced
this issue
Jan 3, 2024
Version: Deno 1.39.1
Currently
.listenQueue()
is typed as the following:The problem is that when consuming the API,
unknown
becomes very restrictive. For example if you were to do something like this:You would get the following error:
Which makes usage quite user hostile. For consumption of APIs where the value could be anything, it is better to use the top type
any
, which is what occurs in several instances in built in types where the value could be of any type.The text was updated successfully, but these errors were encountered: