Exercise
- Open exercise on codesandboxio.
I've imported the necessary
webSocket()
operator for you. - Create a new
WebSocketSubject
using thewebSocket()
operator, set the generic type for the next notification tostring
, and set the url towss://echo.websocket.org
. - Emit a next notification on the newly created
WebSocketSubject
using thenext()
method. - Subscribe to the
WebSocketSubject
instance. - Send some additional messages to the WebSocket.
- Close the WebSocket connection by invoking the
complete()
method on theWebSocketSubject
instance.