title: Types for observable (solved)
body: <p>I would like to have an type for my observable (just for learning purposes). How can I do it for the follwoing lines of code? I get compiler errors and don't understand them.</p>
  <pre><code>type Color = &quot;white&quot; | &quot;green&quot; | &quot;red&quot; | &quot;blue&quot;;
  type Logo = &quot;fish&quot; | &quot;dog&quot; | &quot;bird&quot; | &quot;cow&quot;;
  
  const color$ = new Subject&lt;Color&gt;();
  const logo$ = new Subject&lt;Logo&gt;();
  
  const observabl1:&lt;Subject&lt;Color&gt;, Subject&lt;Logo&gt;&gt; = combineLatest([color$, logo$]);
  
  observabl1.subscribe(([color, logo]) =&gt;
    console.log(`${color} ${logo}`)
  );
  </code></pre>
  <p>and</p>
  <pre><code>const observable2$:Observable&lt;string&gt; = from([&quot;white&quot;, &quot;green&quot;, &quot;red&quot;, &quot;blue&quot;]);
  </code></pre>
  <p><a href="https://i.stack.imgur.com/mrpOQ.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/mrpOQ.jpg" alt="enter image description here" /></a></p>
  <p><strong>Update: I found the error. I imported import { Observable } from 'rx'; Changing it to import { Observable } from 'rxjs'; fixed the problem</strong></p>