Question: As I know the store is a list of states, each state has direct access to his previous or next state. this list is saved in applications memory, if I have a huge amount of data and each state is too big to be saved in every state. How can I permanently delete old store objects to avoid overstock of memory?

at this moment my code looks like this:

```
export const REDUCERS = {
    login: loginReducer,
    register: registerReducer,
    profile: profileReducer,
    company: companyReducer,
    balance: balanceReducer
}
const SdkReducer = compose(storeLogger(), combineReducers)(REDUCERS);

export function reducer(state: any, action: any) {
    if(action.type === 'RESET_STORE'){
        return undefined;
    }

    return SdkReducer(state, action);
}

```

When 'RESET\_STORE' is called root reducer returns 'udefined', But, as I know, there is still saved the old state of the store, which contains old data. I want to delete it permanently. To free some memory.

Answer: 
```
const initialState = appReducer({}, {})

const rootReducer = (state, action) => {
 if (action.type === 'RESET_STORE') {
   state = initialState
 }
 return appReducer(state, action)
}

```
You don't have to do that at all. It's done by the garbage collector of the browser.

Just make sure you don't hold a reference to your previous states somewhere.

For example if you create a middleware which push every previous state into an array, they'll never be cleaned and your memory consumption will increase over time without decreasing.