fromIO
Description
Creates a Socket.io client (Manager) wrapped in an RxJS Observable.
Usage
Basic Usage:
Parameters
url<String>
: The URL of the backend server (like "http://localhost:3000").
Options
topics[String]
: Topics to subscribe to when receiving messages from the server. Defaults to['message']
.socketOptions[Object]
: Options to pass into the socket.io Manager.stop$[Observable]
: The conduit and its observable will terminate (and disconnect) if the stop$ observable emits any items.
Returns
Returns the stream of socket.io events where each emitted item has the form [SocketIO.Manager, {type<String>, data<Object>}
].
Event types include the following:
sockets/CREATE
: {}connections/CONNECT
: {startTime}connections/DISCONNECT
: {reason}messages/NEW
: {topic,message}See
rxsocketio/internals/actions.js
for the full list of raw events.
Last updated