         (.render renderer elt)
         (.getRenderOutput renderer)))))
 
+(defn friendly-pipe
+  "Like core.async/pipe, but gives the browser an opportunity to run higher
+  priority tasks between each element."
+  ([from to] (friendly-pipe from to true))
+  ([from to close?]
+   (go-loop []
+     (let [v (<! from)]
+       (if (nil? v)
+         (when close? (close! to))
+         (when (>! to v)
+           ;; This gives the browser a chance to break away from the pipe
+           ;; process and return later.
+           (<! (async/timeout 0))
+           (recur)))))
+   to))
+
+
 (defn generate
   "Generates signature, morph pairs for component-factory-var (using optional
   generator overrides) and puts them onto ch."

(ns frontend.devcards.morphs
  (:require [cljs.core.async :as async :refer [<! chan]]
            [clojure.spec :as s :include-macros true]
            [clojure.test.check.generators :as gen]
            [goog.object :as gobject]

    (go-loop []
      (when-let [morph (<! morph-ch)]
        (om-next/update-state! this update :morphs conj morph)
        (recur)))))

(defui ^:once ^:private MorphDisplay
