Closed somebody1234 closed 10 months ago
Okay, we can implement it like that. See my last commit. I don't know why this would be useful. Also, I'm not sure if a self-referencing template is a good idea or not, just because it is still working. This also allows the use of symbols and numbers as event names (which is not necessarily a good thing).
Describe the bug
ObservableV2
does not acceptA
as a generic parameter ifA
is not a@typedef
. Related to:72
To Reproduce
See this TypeScript playground link. (Note that the implementation of
lib0/observable
has been copied into the link - the TS playground seems to have problems importing its type definitons from npm)Expected behavior No type errors
See this TypeScript playground link for a demo of a potential solution.
Screenshots N/A
Environment Information
Additional context this is a potential solution:
it is implemented in the link in the "expected behavior" section above
it isn't valid JSDoc syntax though, so it may not be an option if you're planning on generating docs from the source.