rx-socket
TypeScript icon, indicating that this package has built-in type declarations

0.5.0 • Public • Published

rx-socket

RxJS Subject for Node Socket.

Installation

yarn add rx-socket

Usage

import { SocketSubject } from 'rx-socket'
 
const socket = new SocketSubject('/path/to/socket')
 
socket.subscribe(data => {
  // `data` will be an Object, expecting a JSON-encoded string to be provided
  console.log(data)
})
 
// `next()` will encode the provided value to JSON
socket.next({ hello: 'world' })

See the socket.connect() documentation for the supported SocketSubject constructor argument.

License

MIT.
See LICENSE file.

/rx-socket/

    Package Sidebar

    Install

    npm i rx-socket

    Weekly Downloads

    13

    Version

    0.5.0

    License

    MIT

    Unpacked Size

    8.16 kB

    Total Files

    6

    Last publish

    Collaborators

    • aclarke
    • diogoperillo
    • howleysv
    • mosic
    • paul_lecam
    • sarahwiley