title: Setting root page in ionic2 and angular2 app based on an asynchronous event
body: <p>I'm trying to start a basic ionic2 app and was wondering if my timing of initial app loading is a problem or not.  What I'd like to do is set the start page to a login page if the user is not authenticated.  </p>
  
  <p>I originally set the rootpage to the home page and then when the async call came back from localstorage, I would then reset the rootpage to the login page if the user was unauthenticated.  However, this caused a flickering where they see one page and then get sent to another page.</p>
  
  <p>It seems like what I want to do is wait for the local storage call before I show any screen.</p>
  
  <p>My question is this: as the code stands now, will there be an error condition where the platform ready fires before the root page is set, thus causing some sort of problem?  How should I handle this situation in Ionic 2 and Angular 2?  Should I make the get localStorage call synchronous, or should I stuff it in another event or method that is part of the app or page lifecycle in Angular 2?</p>
  
  <p>Should I use some sort of observable or await syntax?</p>
  
  <pre><code>export class MyApp {
    rootPage: any;
    local: Storage = new Storage(LocalStorage);
  
    constructor(platform: Platform) {
  
      this.local.get('user').then(user =&gt; {
        if (user) {
          this.rootPage = TabsPage;
        } else {
          this.rootPage = LoginPage;
        }
      });
  
      platform.ready().then(() =&gt; {
        // Will this ever fire before the rootpage is set?
        StatusBar.styleDefault();
  
      });
    }
  }
  </code></pre>