ReactiveX / rxjs

A reactive programming library for JavaScript
https://rxjs.dev
Apache License 2.0
30.56k stars 3k forks source link

Support WebSocketSubjectConfig accepts 2 generics types instead of 1 #4819

Open alecorsino opened 5 years ago

alecorsino commented 5 years ago

Feature Request

When using WebSocketSubjectConfig for webSocket observable it would be sensible that can accept 2 different generic types instead of one.

Is your feature request related to a problem? Please describe. interface WebSocketSubjectConfig \<T> { ... serializer?: (value: T) => WebSocketMessage; deserializer?: (e: MessageEvent) => T; ... }

Describe the solution you'd like interface WebSocketSubjectConfig<S,D> { ... serializer?: (value: S) => WebSocketMessage; deserializer?: (e: MessageEvent) => D; ... }

Describe alternatives you've considered I need to have an extra layer and common type for request response messages which are completely different in my case and maintaining a common type when they are completely different it make no sense.

mlesin commented 3 years ago

Totally agree. It would be a great feature.