Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's Relay's relationship to Flux?

Tags:

relayjs

Currently Flux is only mentioned once in the Relay docs (deep in the API reference for Relay.Store). I was initially very confused about the relationship between the Relay and Flux. I've seen some small unofficial explanations, e.g.

Relay is an implementation of the Flux pattern.

(from Relay issue #168)

What's the final word on Relay's relationship to Flux?

like image 332
chris Avatar asked Jan 23 '16 00:01

chris


Video Answer


1 Answers

Relay currently supports fetching and rendering data fetched from a GraphQL server. For some applications this can obviate the need for something like Flux, since all data may come from the server. For applications that also need to maintain complex local state - i.e. beyond the scope of component-local state - we recommend using Flux (in particular Redux) in addition to Relay.

Support for managing local state (non-server data) is on the roadmap for Relay - see https://github.com/facebook/relay/issues/114.

like image 174
Joe Savona Avatar answered Dec 03 '22 14:12

Joe Savona