Is there a reason to prefer the FLUX pattern (Action, Dispatcher, Store, View) when retrieving static data? For example, I have a dropdown with a few values:
Cars dropdownMustang, Focus, Pinto
It is possible to load these values via a direct call to the API from getInitialState
. The values available on this dropdown do not change according to any events other than the initial page load. In such cases where data is static is there a reason to go through FLUX, or a Store, as opposed to a direct API call?
The only reason I can think of is to keep the data flow in your app the same. For this single component, with data that will never change (the word never is always dangerous in programming) I can imagine it not being the most useful, but for keeping the flow the same it is useful. If you come back to your app (or this part) in 6 months (for example) it can be helpful if it all works more or less the same.
Also (noted by @wintvelt) the initial state can also be different (empty) before the API call returns (certainly something that I have basically everywhere).