rrr

react-relay-redux

Redux integration for Relay

Showing:

Popularity

Downloads/wk

2

Maintenance

No Maintenance Data Available

Package

Dependencies

0

Size (min+gzip)

0.6KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

react-relay-redux

Redux integration for Relay

Overview

react-relay-redux lets you listen and respond to Relay queries and mutations using Redux actions and reducers.

Install

$ npm install --save react-relay-redux

Usage

RegisterRelayDispatcher

react-relay-redux exports a RelayNetworkDispatch function that takes your Relay environment and a dispatch function for your Redux store.

import Relay from 'react-relay'
import {RegisterRelayDispatcher} from './react-relay-redux'
import store from 'your-redux-store'

/* register a network subscriber */
RegisterRelayDispatcher(Relay.Store, store.dispatch)

/* then pass it to your renderer or root container */
<Relay.Renderer
  environment={Relay.Store}
  ...

RelayReduxActions

You can import and use the following actions:

  • RELAY_QUERY - when a Relay query is issued
  • RELAY_QUERY_SUCCESS - when a Relay query is successful
  • RELAY_MUTATION - when a Relay mutation is issued
  • RELAY_MUTATION_SUCCESS - when a Relay mutation is successful

Coming Soon

  • RELAY_{QUERY,MUTATION}_FAILURE support

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100