title: Clearing redux state on logout NGRX
body: <p>actions </p>
  
  <pre><code>import { createAction } from '@ngrx/store';
  
  export const logOut = createAction('[APP] LOGOUT');
  </code></pre>
  
  <p>Reducers</p>
  
  <pre><code>import { createReducer, on } from '@ngrx/store';
  import * as LogoutActions from '../actions';
  
  export const clearStateReducer = createReducer(
    on(LogoutActions.logOut, state =&gt; {
      return (state = undefined);
    })
  );
  </code></pre>
  
  <p>app.module</p>
  
  <pre><code>StoreModule.forRoot(reducers, { metaReducers: [clearStateReducer] }),
  </code></pre>
  
  <p>I'm trying to reset the state on clicking the logout button. I did clear the localstorage but I also need to clear redux state. So followed this example <code>https://medium.com/@moneychaudhary/how-to-reset-the-state-or-clear-the-store-on-logout-in-ngrx-store-d2bd6304f8f3</code>
  But I get error on metareducers, I need somehelp in fixing this.Thank you. I have attached the error screenshot</p>
  
  <p><a href="https://i.stack.imgur.com/zY22r.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zY22r.png" alt="enter image description here"></a></p>