Exercise - WebSocketSubject

Subject Variants

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://echo.websocket.org.
  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.

Exercise - WebSocketSubject

Subject Variants

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://echo.websocket.org.
  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.

Copyright

Site © by LiveLoveApp, LLC

We Can Help!

Need help with RxJS in your project?

Hire Us