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 don't understand why addEventListener is loose when it directly depends over dispatchEvent which is strict. Shouldn't the loosest implementation based over regular string be removed ? It would raise error when listening to none defined event and thus be more type safe 🤔
It will be especially useful when creating custom controls inheriting from EventDispatcher.
The text was updated successfully, but these errors were encountered:
Good question! Those may have been left in by mistake in #369. I'm experimenting with removing them in #1145, but it does seem to break some tests, so I need to look into that some more.
The
EventDispatcher
only has one method definition fordispatchEvent
which is strict.three-ts-types/types/three/src/core/EventDispatcher.d.ts
Line 84 in c8cea80
While there are multiple method definitions for
addEventListener
which make the typing a bit loose.three-ts-types/types/three/src/core/EventDispatcher.d.ts
Lines 52 to 55 in c8cea80
three-ts-types/types/three/src/core/EventDispatcher.d.ts
Line 56 in c8cea80
I don't understand why
addEventListener
is loose when it directly depends overdispatchEvent
which is strict. Shouldn't the loosest implementation based over regular string be removed ? It would raise error when listening to none defined event and thus be more type safe 🤔It will be especially useful when creating custom controls inheriting from
EventDispatcher
.The text was updated successfully, but these errors were encountered: