 
 (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

         :error (fn [res]
                  (put! c {:success false :res res}))}))
    c))

#_(defn $nav [{:keys [examples see-alsos notes]} owner]
    (reify
      om/IRender
      (render [_]
        (html
          [:div
           [:h5 "Nav"]
           [:ul
            [:li [:a {:href "#"
                      :data-animate-scroll "true"
                      :data-animate-buffer "20"}
                  "Top"]]
            [:li [:a {:href "#examples"
                      :data-animate-scroll "true"
                      :data-animate-buffer "20"}
                  "Examples "
                  [:span.badge (count examples)]]]
            [:li [:a {:href "#see-also"
                      :data-animate-scroll "true"
                      :data-animate-buffer "10"}
                  "See Also "
                  [:span.badge (count see-alsos)]]]
            (when (> (count notes) 0)
              [:li [:a {:href "#notes"
                        :data-animate-scroll "true"
                        :data-animate-buffer "10"}
                    "Notes"
                    [:span.badge (count notes)]]])]]))))

(defn $nav [!state owner]
  (let [{:keys [examples see-alsos notes]} @!state]

                     (close! ch))
                   ch))
               :clojuredocs.examples/save handle-save-example})]

    (rea/render-component
      [examples/$examples-widget !state bus]
