0.2.1 • Published 5 years ago

@absinthe/socket-relay v0.2.1

Weekly downloads
1,518
License
MIT
Repository
github
Last release
5 years ago

@absinthe/socket-relay

Absinthe Socket Relay

Installation

Using npm

$ npm install --save @absinthe/socket-relay

Using yarn

$ yarn add @absinthe/socket-relay

Examples

  • 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

  • absintheSocket AbsintheSocket
  • onError function (error: Error): any

Returns FetchFunction

createSubscriber

Creates a Subscriber (Relay SubscribeFunction) using the given AbsintheSocket instance

Parameters

  • absintheSocket AbsintheSocket
  • onRecoverableError function (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

  • disposable Disposable

Returns Promise<boolean>

References

License

MIT :copyright: Jumpn Limited.

0.2.1

5 years ago

0.2.0

5 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

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