How to manage memory in a reduction reaction?

As we know, the provider will provide all the data stored in the store to our application, but I'm interested in memory, because in the creation store we save all the data of our application. Now, if my application has several pages with huge data, then all the data will be saved, in this case there is a risk of memory leak. So, how can we clean and store data in a reduction reaction dynamically to overcome this memory leak.

I save the data in the create store as:

  • First I have a gearbox with all the data.

    export const makeRootReducer = (asyncReducers) => {
      return combineReducers({
        location: locationReducer,
        req:allReducers,
        user: home,
        ...asyncReducers
      })
    }
    
  • In the Create store I pass this gearbox.

    const store = createStore(
      makeRootReducer(),
      initialState,
    
      composeEnhancers(
        applyMiddleware(...middleware),
        ...enhancers
      )
    )
    

Please suggest me how can I avoid a memory leak ?

+4
3

, . , .

, , , , redux-thunk . : (http- ).

, , , , .

,

0
  • , . , , . . : LRU, LFU
  • , .

- .., , ; :)

0

, .

  • , . .
  • ( npm)
  • .
  • not cause unnecessary rendering in a component or its child (shouldComponentUpdate lifecyle)
0
source

Source: https://habr.com/ru/post/1665283/


All Articles