Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Use Relay to fetch and store data outside of a React component

NotificationsYou must be signed in to change notification settings

acdlite/relay-sink

Repository files navigation

build statusnpm version

Usage

import{createSink}from'relay-sink';constTyrionSink=createSink({// Normal Relay Container configurationfragments:{tyrion:()=>Relay.QL`      fragment on Character {        name,        house      }    `}});// A sink is a Relay Container. Compose with parent Relay containers like// normal. Note that `this.props.tyrion` and `fragments.tyrion` below are not// the same value — the former points to a value inside Relay's global store,// while the latter is the actual unwrapped data.<TyrionSinktyrion={this.props.tyrion}onFragmentUpdate={fragments=>{expect(fragments.tyrion.name).to.equal('Tyrion');expect(fragments.tyrion.house).to.equal('Lannister');// Do whatever you want with the data — e.g. dispatch it to a Flux storestore.dispatch({type:UPDATE_TYRION,payload:fragments.tyrion});}}/>

About

Use Relay to fetch and store data outside of a React component

Resources

Stars

Watchers

Forks

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp