LiveLoveApp logo

Exercise - WebSocketSubject

Exercise

  1. Open exercise on codesandboxio. I've imported the necessary webSocket() operator for you.
  2. Create a new WebSocketSubject using the webSocket() operator, set the generic type for the next notification to string, and set the url to wss://websocket-echo.com.
  3. Emit a next notification on the newly created WebSocketSubject using the next() method.
  4. Subscribe to the WebSocketSubject instance.
  5. Send some additional messages to the WebSocket.
  6. Close the WebSocket connection by invoking the complete() method on the WebSocketSubject instance.