title: NgRX effect called with empty state
body: <p>I am having some troubles with the state of a redux app. Let's say that a couple of actions update the state. When an NgRX effect is triggered then suddenly the state disappears and the next action that goes to the reducer takes the initialState.</p>
  
  <p>Here is my effect:</p>
  
  <pre><code>@Effect() getConfiguration$ = this.actions$.pipe(
      ofType(PlasmaAction.PlasmaActionTypes.GET_CONFIGURATION),
      switchMap((action: PlasmaAction.PlasmaActions) =&gt; {
          return this.plasmaService.send(action.payload).pipe(
              map(result =&gt; {
              return new PlasmaAction.SetConfiguration(result);
              })
          );
      })
  );
  </code></pre>
  
  <p>Up to dispatching the GET_CONFIGURATION action the state is fine, but then the state looks this way: 
  <a href="https://i.stack.imgur.com/BZemM.png" rel="nofollow noreferrer">redux-dev-tools-screenshot</a> and the state is empty. Am I missing something?</p>
  
  <p>P.S. The SET_CONFIGURATION is dispatched and updates the state with the new configuration and all other attributes are back to the initial ones.</p>
  
  <p>@EDIT: Here is my reducer. With a little bit of debugging from my side:</p>
  
  <pre><code>export function plasmaReducer(state: PlasmaState, action: PlasmaActions) {
  if (!state) {
      console.log('%c STATE IS EMPTY', 'color:red;');
      state = initialState;
  }
  switch (action.type) {
      case PlasmaActionTypes.CONNECTION_OPENED: {
  
          return { ...state, connected: true };
      }
      case PlasmaActionTypes.CONNECTION_CLOSED: {
          return { ...state, connected: false };
      }
      case PlasmaActionTypes.SET_CONFIGURATION: {
          return { ...state, configuration: action.payload };
      }
  }
  </code></pre>
  
  <p>}</p>