David Gilbertson
1 min readApr 9, 2020

--

Thanks! I don’t think a change to the store structure is any harder/easier to refactor as a result of whether the store is global or not. Take, for example, a store with this shape:

initStore({
store1: {},
store2: {
areaA: {},
areaB: {},
},
store3: {},
});

Only areas of the application that read from store.store2.areaB would need to be changed if you changed the data within that part of the store. If you altered data inside store.store3, components that only read from store.store1 wouldn’t require any changes at all.

Whether you have 10 stores, or one store with 10 top-level properties, doesn’t impact the number of places in which one of the properties are referenced.

--

--

David Gilbertson
David Gilbertson

No responses yet