 
 (enable-console-print!)
 
-(defn throttle [in ms]
-  (let [c (chan)
-        timer (atom nil)]
-    (go-loop []
-      (when-let [new-text (<! in)]
-        (js/clearTimeout @timer)
-        (reset! timer (js/setTimeout #(put! c new-text) ms))
-        (recur)))
-    c))
-
 (defn ajax-chan [opts]
   (let [c (chan)]
     (ajax

                         ex)))
                vec)))

(defn update-example-loop [!state ex-chan]
  (go-loop []
    (when-let [{:keys [body _id]} (<! ex-chan)]
      (swap! !state update-example _id
        #(merge % {:loading? true}))
      (let [res (<! (req-update-example _id body))]
        (if (:success res)
          (swap! !state update-example
            _id #(merge
                   %
                   (:data res)
                   {:loading? false :editing? false}))
          (swap! !state update-example
            _id #(merge % {:error (:message res)
                           :loading? false}))))
      (recur))))

(defn req-delete-example [_id]
  (let [c (chan)]
    (ajax

     :add-example {}
     :add-see-also {}
     :add-note {}
     :user nil}
    (util/page-data!)))

(defn update-example [{:keys [examples] :as state} _id f & args]
  (assoc state
