title: rxjs observable.of(object) returns {"_isScalar": "", "value": {}, "scheduler": "" } instead of value
body: <p>I am fairly new to rxjs.</p>
  
  <p>I tried to create a function that runs a angular 2 http request like that:</p>
  
  <pre class="lang-js prettyprint-override"><code>syncFromApi$() {
  
    // create Headers
    ...
  
    let ob$ = this.http.post(
      CONFIG_APP.apiEndpoint + '/sync/app',
      '',
      { headers: headers }
    )
    .map((response:Response) =&gt; {
      return Observable.of({type: "success", payload: response.json()});
    })
    .catch(function (err:Response) {
      return Observable.of({type: "error", payload: err.json()});
    });
  
    return ob$;
  }
  </code></pre>
  
  <p>In short, when having success, I am returning an Object which indicates, if the request was successful. After that I want to switch map depending on the returned object: </p>
  
  <pre class="lang-js prettyprint-override"><code>let o$ = syncFromApi$()
    .switchMap((value) =&gt; {
      console.log("value", JSON.stringify(value, null, 0));
      if (data.type === 'success') {
        return Observable.of(1);
      } else if (data.type === 'error') {
        return Observable.of(2);
      }
    });
  </code></pre>
  
  <p>And here comes the problem I face. The console.log(...) outputs a object like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>value, {"_isScalar": true, "value": THIS_IS_WHAT_I_NEED_AS_VALUE, "scheduler": null}
  </code></pre>
  
  <p>But I need only the object I returned with the syncFromApi$ function.</p>
  
  <p>Can anyone explain to me, if I am using <code>observable.of()</code> in the wrong manner?</p>
  
  <p>I tried <code>observable.of(1)</code> and it returns 1 as value. If I use a object (<code>observable.of({ type: "myType", message: "myMessage" })</code>), it returns an object wrapping the object I need with the keys "_isScalar", "value" and "scheduler".</p>
  
  <p>Thanks in advance.</p>