>
<p>Given the way Dart generics work, one cannot simply use the <code>is T</code> / <code>as T</code>
checks and castings with this method alone. Therefore, the
<code>TypeToken</code> class was introduced to capture the type of class you'd
like <code>ofType</code> to filter down to.</p>
<h3 id="examples">Examples</h3>
<pre class="language-dart"><code>new Observable.fromIterable([1, "hi"])
  .ofType(new TypeToken&lt;String&gt;)
  .listen(print); // prints "hi"
</code></pre>
<p>As a shortcut, you can use som