RXJS: SwitchMap converts string into single characters unexpectedly : <p>I am playing around with RXJS for TypeScript and stumbled upon an issue that I cannot explain myself. I have an <code>observable</code> that emits multiple strings. I then want to apply <code>switchMap</code> to it which is supposed to prepend "a" to each of those strings:</p>

<pre><code>var o = Observable.create((observer) =&gt; {
    observer.next("hi")
    observer.next("bla")
})

o.switchMap(str =&gt; "a" + str).subscribe(str =&gt; console.log(str))
</code></pre>

<p>My expected output:</p>

<pre><code>ahi
abla
</code></pre>

<p>Actual output:</p>

<pre><code>a
h
i
a
b
l
a
</code></pre>

<p>So somewhere between switchMap and subscribe, the string gets broken down into characters apparently.</p>

<p>Can someone explain why this happens?</p>
