What's Relay's relationship to Flux?

柔情痞子 提交于 2019-12-01 05:16:50

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/34958295/whats-relays-relationship-to-flux

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!