@mainframe/rpc-browser
RPC for browser
Last updated 2 years ago by paul_lecam .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install @mainframe/rpc-browser 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.3.0                                ...           latest (2 years ago)

6 Versions

  • 0.3.0                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Downloads
Today 0
This Week 0
This Month 2
Last Day 0
Last Week 1
Last Month 2
Dev Dependencies (0)
None

Copyright 2014 - 2016 © taobao.org |