Package Exports
- @activimetrics/socket-relay
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@activimetrics/socket-relay) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@activimetrics/socket-relay
Absinthe Socket Relay
Installation
Using npm
$ npm install --save @activimetrics/socket-relayUsing yarn
$ yarn add @activimetrics/socket-relayExamples
- relay-environment.js
// @flow
import {createFetcher, createSubscriber} from "@absinthe-phoenix-socket-relay";
import {Environment, Network} from "relay-runtime";
import absintheSocket from "./absintheSocket";
export default new Environment({
  network: Network.create(
    createFetcher(absintheSocket),
    createSubscriber(absintheSocket)
  ),
  store: new Store(new RecordSource())
});API
createFetcher
Creates a Fetcher (Relay FetchFunction) using the given AbsintheSocket instance
Parameters
- absintheSocketAbsintheSocket
- onErrorfunction (error: Error): any
Returns FetchFunction
createSubscriber
Creates a Subscriber (Relay SubscribeFunction) using the given AbsintheSocket instance
Parameters
- absintheSocketAbsintheSocket
- onRecoverableErrorfunction (error: Error): any
Returns SubscribeFunction
isSubscribed
Returns a promise that resolves to true in case subscription of given
disposable has started or to false otherwise
Parameters
- disposableDisposable
References
License
MIT ©️ Jumpn Limited.