-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WebSocketCtor in WebSocketSubject must allow more params in new instance #2933
Comments
Hi, @njl07, both options expected by WebSocket can be passed via the configuration object I'm not sure what |
Hy @benlesh but If we want to pass custom I think so it’ll be nice to have the faculty to pass more options and if it’s It can be very helpful for many people especially if we use Thanks to think about it |
I see. Hmmm... Honestly, in the near future I'd like to take stuff like this and the AJAX stuff and move it to a DOM related package instead of in core. I'm not sure how I feel about updating this library to support a non-standardized API from a third party. So I'm going to say my answer is "no" for now, but I'll reopen the issue and allow others, like @kwonoj to comment. Thank you for the suggestion! |
First, thanks to considering this issue. Second, I think standard is not just the If we want to communicate between And send custom All libraries like My friend and I have created a new |
Perhaps some factory function that produces web socket instance and accepts all of the options might solve this cleanly? It would be a breaking change, of course. cc @kwonoj |
Or maybe an operator to pass options on |
@njl07 an operator isn't really doable, as operators will return a new Observable without altering the source. This is more something we'd need to be able to handle at the observable creation method. |
@benlesh do you think you'll treat this one ? Thanks |
@benlesh The |
@benlesh since v7 is coming up, could we make this breaking change? WebSocketCtor?: { new (url: string, protocols?: string | string[]): WebSocket }; Would be replaced by: webSocketFunc?: (url: string, protocols?: string | string[]) => WebSocket; I'm happy to open a PR for it, I already use this in my code. |
RxJS version: v5.4.3
Code to reproduce: Not a bug but an ask for enhancement
Expected behavior:
WebSocketCtor
must allow all options that we can have in WebSocketClientMissing options can be passed inside WebSocketSubjectConfig like
url
andprotocol
Actual behavior:
Only two options are allowed in WebSocketCtor
The text was updated successfully, but these errors were encountered: