0.1.5 • Published 6 years ago

@observable-rpc/client v0.1.5

Weekly downloads
1
License
Apache-2.0
Repository
github
Last release
6 years ago

@observable-rpc/client

Creates a router that accepts WebSocket requests for methods to be run on the server.

Use the @observable-rpc/router package to determine what methods will be exposed to the browser.

API

ObservableRpcClient(url)

import { ObservableRpcClient } from '@observable-rpc/client'
const client = new ObservableRpcClient(options)

Wraps a Socket.IO client to send requests to the server and handle responses.

options

  • options.url: String

    The protocol+hostname+port+path the ObservableRpcClient should use to talk to the ObservableRpcRouter. When run in the browser this will default to the current protocol+host+port and the path /rpc.

  • options.consumeLog$: (log$) => void

    By default log messages from ObservableRpcRouter are handled with debug. Pass a consumeLog$ function to receive a stream of log events to handle them yourself. Log events have the following properties:

    • level: 'error'|'info'|'debug': The level for the log message

    • msg: String: The log message, probably pretty short

    • data: any: Metadata relevant to the specific log message

methods

  • ObservableRpcClient#call(method, params): Observable

    Call a method on the server. Returns an Observable (from RxJS 6) that mirrors the values/errors/completion of the observable from the server

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago