New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

relay-connection-handler-plus

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

relay-connection-handler-plus

Relay connection handler with additional functionality

latest
Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
4.6K
30.22%
Maintainers
1
Weekly downloads
 
Created
Source

Relay Connection Handler Plus! npm

Relay connection handler with additional functionality.

Usage

import ConnectionHandler from 'relay-connection-handler-plus';
import { Environment } from 'relay-runtime';

function handlerProvider(handle) {
  switch (handle) {
    case 'connection':
      return ConnectionHandler;
    default:
      throw new Error(`no handler configured for ${handle}`);
  }
}

const environment = new Environment({
  handlerProvider,
  /* ... */
});

Relay Connection Handler Plus! provides an enhanced connection handler that can be used in place of the default connection handler.

This connection handler exposes an additional getConnections method. This method allows getting all connections for a connection key, per facebook/relay#1861:

const connections = ConnectionHandler.getConnections(record, connectionKey);

The getConnections method also allows getting a subset of connections for a given connection key that were fetched with args matching a filter function. For example, it can be used to get all connections loaded with color: "red", regardless of the other arguments on the connection:

const connections = ConnectionHandler.getConnections(
  record,
  connectionKey,
  ({ color }) => color === 'red',
);

Keywords

relay

FAQs

Package last updated on 15 Jul 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts