@mainframe/rpc-browser
TypeScript icon, indicating that this package has built-in type declarations

0.3.0 • Public • Published

rpc-browser

rpc-request or rpc-stream factory with automatic transport selection.

Installation

yarn add @mainframe/rpc-browser

Usage

import browserRPC from '@mainframe/rpc-browser'

const rpcOverHTTP = browserRPC('http://localhost') // RequestRPC using HTTP transport
const rpcOverWS = browserRPC('ws://localhost') // StreamRPC using WebSocket transport

API

browserRPC()

Arguments

  1. endpoint: string: HTTP or WebSocket URL to connect to.

Returns RequestRPC (with HTTP endpoint) or StreamRPC (with WebSocket endpoint).

License

MIT

Dependencies (3)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @mainframe/rpc-browser

    Weekly Downloads

    0

    Version

    0.3.0

    License

    MIT

    Unpacked Size

    3.46 kB

    Total Files

    6

    Last publish

    Collaborators

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