4 ms·
I just used Redux on something pretty complex. The page starts with four different API calls to get a mass of data with which it populates the state and the pag
by JohnMunsch 11y ago
I just used Redux on something pretty complex. The page starts with four different API calls to get a mass of data with which it populates the state and the page can get going. It does anywhere from 1 to 25 more calls to get graph data but that comes down while the page is already in a state where the user can start interacting with it.
Any time the user interacts with the data on one line (among hundreds or thousands) calculations are redone at four different levels so we don't have to keep going back to the back-end to update the data, instead we can keep working with the data we already have.
So... With all that said, how did it work with Redux. Eh. Not so bad. I don't love it the way I loved AngularJS after I used it for the first time, but it's OK. The results are complicated but given how we're using it and what we're doing, I don't know how it wouldn't be complicated. I dislike that there's going to be a significant learning curve for anyone who encounters this page in the future, but the previous version of the page was a total trainwreck. At least this time I can do a lot of stuff and envision changes to the calculations and how it all updates and I don't break out in a sweat.
The biggest area I ran into problems was that a lot of the data we need to keep up-to-date is derived data (for example, an array of data for Angular UI Grid which has to use a heavily modified version of data in the state). Redux doesn't really do anything to help you update that as needed.
There are a lot of reasons there are so many plugins and add-ons for Redux, I think you might find it interesting to go over those so you can learn some of the themes they have and see what problems they try to solve. Actually, I think that's a worthwhile thing to do with any new technology. Go look at all the software which has sprung up to fill in the holes and you'll learn a lot.