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
I attempted to write the following type definition for my object that mixes in on from nanoevents:
import{Emitter}from'nanoevents'exporttypeMyObject={// other methods ...on: Emitter<StorageEvents>['on']}
But this fails because the type definition of on requires this to be the Emitter object. Is there a reason for that restriction? I feel like having a convenient way to define types for mixin would be a great advantage.
Alternatively, nanoevents could expose a separate, generic type definition just for the mixed in on method:
I attempted to write the following type definition for my object that mixes in
on
from nanoevents:But this fails because the type definition of
on
requiresthis
to be theEmitter
object. Is there a reason for that restriction? I feel like having a convenient way to define types for mixin would be a great advantage.Alternatively, nanoevents could expose a separate, generic type definition just for the mixed in
on
method:The text was updated successfully, but these errors were encountered: