Ad

Is It Bad Practice To Duplicate Data Across Different Flux Stores?

- 1 answer

Say you want each feature to have it's own store for modularity, but multiple features may need the same data x. Is it bad practice to hold x in Feature1Store, Feature2Store, etc?

Ad

Answer

Yes if the store represents the state of the data. No if the store represents the state of the component. A well excepted rule about data is that you only want one instance of that data. Otherwise you will have consistency issues. But if the data is not changing and you only are providing sorting, filtering or some other component level state multiple instances are ok.

Ad
source: stackoverflow.com
Ad