title: Ionic 4 Observables
body: <p>I have been trying to implement the rxjs Observable pattern in a Ionic 4 upgrade project with no success and I would like to know how to successfully implement Observable so that the expected result would be displayed on-screen.</p>
  
  <blockquote>
    <p>This is the old way of doing things and somewhere 'user:loggedIn' is
    used to display x results on-screen.</p>
  </blockquote>
  
  <pre><code> events.subscribe('user:loggedIn', (userEventData) =&gt; {
     this.getUserInfo(userEventData);
     this.registerPushNotifications();
     this.registerPushNotificationHandlers();
   });
  </code></pre>
  
  <p>Two ways implemented and tested but no results are displayed.</p>
  
  <p><strong>Method 1:</strong></p>
  
  <pre><code>    let userLoggedIn = new Observable((observer) =&gt; {
        // const {next, error} = observer;
  
        observer.next({'user:loggedIn':observer});
        observer.complete();
      });
  
      userLoggedIn.subscribe((userEventData) =&gt; {
        console.log(userEventData)
        this.getUserInfo(userEventData);
        this.registerPushNotifications();
        this.registerPushNotificationHandlers();
      });
  </code></pre>
  
  <p><strong>Method 2:</strong></p>
  
  <pre><code>    var observer: Observable&lt;any&gt; = of();
      observer.subscribe(userEventData =&gt; {
        this.getUserInfo(userEventData);
        this.registerPushNotifications();
        this.registerPushNotificationHandlers();
      });
  </code></pre>
  
  <blockquote>
    <p>Is there a way to have the same functionality as the old Ionic events
    functionality in Ionic 4 using Observable or Subject implementations?</p>
  </blockquote>