3 ms·
- withLocalSelector() allows us to mount multiple kepler.gl component instance in the reducer and select which one to dispatch and read from. We wrap around con
by heshan0131 8y ago
- withLocalSelector() allows us to mount multiple kepler.gl component instance in the reducer and select which one to dispatch and read from. We wrap around connect(), so the user doesn't have to worry about it. They can mount as many kepler.gl instances as they want and it should just work.
- I know nested state has performance drawbacks, that's why we try to flatten certain properties with large arrays, such as datasets, layers, and layer data. But for other properties that are simple strings, floats or boolean, I think it's fine to have them nested. Because we have this reducer plugin feature, where developers can add custom reducer handlers, I try to keep the number of reducer small, so it's easier to explain what they each do. Besides that, I came across couple of cases where 1 action updates multiple reducers sequentially, I don't want to add thunk, so we then had to add this composer function which is kinda complex.
There are lots of questions, don't have time to answer them all, but I would love to keep this conversation going. :)