Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Question] Using this library with Redux and combine reducers #424
I'm just getting started with an app, I'm trying to use Redux with built_value. The app is working but I've needed to add .toBuilder() in all of the reducers (ie, https://github.com/invoiceninja/flutter-mobile/blob/master/lib/redux/app/app_reducer.dart#L14).
Is a terrible mistake or the right way to do it?
Thanks for your help and the great library!
Very good question. Yes, there is a better way to do it. Instead of assigning a builder, use the 'replace' method:
This is a bit less typing and a bit more efficient.
Thank you so much! Can I ask a quick follow up question.
Our API returns a list of objects however to follow Redux best practice we're storing the the data as a map and an array. We're currently first creating maps/lists and then creating the built values, is there a more performant approach?
Thanks again for your help and the libraries, they're awesome :)