WebSocket transport
Purpose
WebSocket transport for browser or Node as a RxJS Subject
.
Installation
For browser
npm install @erebos/transport-ws-browser
For Node
npm install @erebos/transport-ws-node
Usage
import { createTransport } from '@erebos/transport-ws-browser'
const transport = createTransport('ws://localhost')
transport.subcribe({
next: message => {
console.log(message)
},
})
transport.next({ hello: 'transport' })
API
createTransport()
Arguments
url: string
Returns Rx.Subject<Object>