title: defer() no longer allows the observable return type
body: <p>Today I did an upgrade from angular 6 to 7</p>
  
  <p>Along with it I had to upgrade rxjs from 6.1.0 to 6.3.3 and typescript from 2.7.2 to 3.1.1</p>
  
  <p>And now this ngrx effects method is throwing a typescript error:</p>
  
  <pre><code>  @Effect()
    init$ = defer(() =&gt; {
      const userData = localStorage.getItem('user');
      return (userData)
        ? of(new Login(JSON.parse(userData)))
        : of(new Logout());
    });
  </code></pre>
  
  <blockquote>
    <p>Argument of type '() => Observable | Observable' is not
    assignable to parameter of type '() => void | Subscribable |
    Subscribable | PromiseLike | InteropObservable'.</p>
  </blockquote>
  
  <p>It seems that I can no longer use defer to dispatch an action like this, so I'm not sure how I can write initialization effects moving forward. </p>
  
  <p>I just need to wait for the store to be initialized, so in this method I am deferring the execution until the effects have subscribed to the actions stream.</p>
  
  <p><strong>Does anyone know how I can work around this?</strong></p>
  
  <p>UPDATE:</p>
  
  <p>I also found a <a href="https://stackblitz.com/edit/ngrx-feature-init-effect?file=app%2Fcore.effects.ts" rel="nofollow noreferrer">Stackblitz</a> example that leverages <code>ROOT_EFFECTS_INIT</code>, but due to the fact that I am in a feature module, this doesn't work (<a href="https://github.com/ngrx/platform/issues/683" rel="nofollow noreferrer">discussed here</a>) </p>
  
  <pre><code>import { ROOT_EFFECTS_INIT } from '@ngrx/effects';
  
  @Effect()
    init$ = this.actions$
      .ofType(ROOT_EFFECTS_INIT)
      .pipe(
        map(() =&gt; {
          const userData = localStorage.getItem('user');
          return (userData)
            ? of(new Login(JSON.parse(userData)))
            : of(new Logout())
        })
      );
  </code></pre>