How exactly does the garbage collector work with reduction? We all know that redux contributes to immutability. So what happens to instances of deprecated states? For example, in my gearbox, if I have a case, for example:
...
case 'MY_ACTION':
return state.set('name', action.name)
...
Now, if I run the action MY_ACTION100 times, the code will create a new object 100 times.
My question is what will happen to previous state objects that are no longer in use. Will they be left in the javascript / browser garbage collector to decide what to do? If so, isn't that a performance issue, i.e. Too many deprecated state objects increase the load on the javascript garbage collector and thereby reduce code performance?
source
share