Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Yeah they didn't before but I'm working on adding it now. That's what a lot of the refactoring is, adding immutable and normalizing the store... Amongst other things...
-
avstuff3308yI am mildly shocked that your team is actually able to mutate a state and still get a response out of a component. When I started with React, I implemented a redux store with immutable simply because it was the easiest way I could figure out how to get a component to update.
Granted, back then, I had very little understanding of how the components update and how the redux store plays a part in this.
Also before immutable, I tried a method for cloning objects to provide a state change but it was not compatible in IE. I try to forget those days.
Now I just wish I had more projects that included React and Redux. -
@avstuff haha it was only working for one view and when we added the immutable records to our state, the project basically imploded lol jk but I mean it was pretty bad
-
avstuff3308y@reduxtris possibly a mapStateToProps binding issue? I think immutable object attributes must be retrieved with the get or getIn methods. Quick fix would be to toJS the state and retrieve attributes using dot notation.
-
Yeah that is the issue, I'm currently converting everything to immutable records so we can keep the dot notation in as many places as possible
-
avstuff3308y@reduxtris That's a tedious task. Components, Actions, and Reducer cases. Plus the testing to go along with everything. I don't envy your refactoring.
Related Rants
Pretty sure my team isn't following best practices in terms of managing state with redux and react... We are already having to rewrite most of the project because they were mutating the state EVERYWHERE. Glad they got the css looking decent so they could hide behind that for a couple of months.
undefined
sigh
react
101
redux