Adding additional generic to WebSocketSubject #6018
jkossis
started this conversation in
Ideas / Feature request
Replies: 1 comment
-
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Both
WebSocketSubject<T>
and it's creator functionwebSocket<T>
currently only take one generic, for distinguishing the type that the internal Subject holds. As it currently stands,.next(data: T)
and.subscribe((data: T) => { ... })
force the data to be of the same type.However, data emitted to the web socket server could be of a different shape/form than the data received from the web socket server. What are people's thoughts on extending this functionality to include a 2nd generic, perhaps of type
R
, to allow for stronger typing on non-symmetrical communication?Beta Was this translation helpful? Give feedback.
All reactions