|
|
|
|
|
by jefftchan
4154 days ago
|
|
For me, the part of Flux that's difficult to understand is how server data flows into the cycle (left-hand side of the diagram). The Flux docs only recommends that server interactions should be done from the Action Creators. However, things are actually more complicated than that: - how do you resolve server / client data conflicts? - how do stores work with a RESTful API? - how do you handle network failures, retries, etc? At Quizlet, we designed a hybrid solution [1] with "syncers" that act as the gateway for network I/O. Syncers are responsible for taking view-level data (ViewModels) and exchanging them with the server (ServerModels). It works well with our REST API. Yahoo has also released their own thing called Fetchr [2] which is more tightly integrated to stores. I'm curious to see how other people are approaching this problem. [1] https://news.ycombinator.com/item?id=8954733 [2] https://github.com/yahoo/fetchr |
|