title: Typescript return type for Observables in getter and setter
body: <p>I'm building an app using Angular 2 with Typescript. What return type my setter and getter should have?</p>
  <pre><code>import { Injectable } from '@angular/core';
  import { Http, Response } from '@angular/http';
  import { Events, SqlStorage, Storage } from 'ionic-angular';
  import { Subject } from 'rxjs/Subject';
  
  
  export interface User {
    name?: string,
    email?: string,
    gender?: string,
    picture?: Object
  }
  
  export interface DataStore {
    user: User
  }
  
  @Injectable()
  export class UserService {
    
    private storage: Storage;
    private _user$: Subject&lt;User&gt;;
    private dataStore: DataStore;
  
    constructor(
      private http: Http
    ) {
      this.storage = new Storage(SqlStorage);
      this._user$ = new Subject();
      this.dataStore = { user: {} };
    }
  
    set user$(user: User) {
      this.storage.set('user', JSON.stringify(user));
      this.dataStore.user = user;
      this._user$.next(this.dataStore.user);
    }
  
    get user$() {
      const subject = this._user$;
      const source = subject.asObservable();
      return source;
    }
  
  }
  </code></pre>
  <p>I have tried this:</p>
  <pre><code>set user$(user: User): void {}
  get user$(): Observable&lt;User&gt; {}
  </code></pre>
  <p>But throw these errors:</p>
  <blockquote>
  <p>Error TS2380: 'get' and 'set' accessor must have the same type. Error</p>
  <p>TS1095: A 'set' accessor cannot have a return type annotation. Error</p>
  <p>TS2380: 'get' and 'set' accessor must have the same type. Error</p>
  <p>TS2322: Type 'User' is not assignable to type 'Observable'.</p>
  <p>Error TS2322: Type 'User' is not assignable to type</p>
  <p>'Observable'. Property '_isScalar' is missing in type 'User'.</p>
  </blockquote>