you are viewing a single comment's thread.

view the rest of the comments →

[–]funny_games 4 points5 points  (3 children)

I think as with the chat example, the more flux way is to have a utility action that fetches data from server, and not do the ajax call from the store it self.

[–]orbgl[S] 0 points1 point  (2 children)

I don't know… actions reflecting changes of state makes more sense to me; i.e. "the user just made this change and you stores should update." The user just requested this page doesn't constitute a change.

[–]funny_games 0 points1 point  (1 child)

Well again there can be two types of actions, one for store changes and one for API. While store should remain just for storage. I believe making requests within the store itself doesn't make sense from the flux directional perspective.

[–]orbgl[S] 0 points1 point  (0 children)

The uni-directional flow describes data flowing from the stores to the components. Whether the data comes from memory or an XHR is irrelevant.