 ;; =============================================================================
 ;; Components
 
-(defn item-view [item owner {:keys [current-item sync]}]
+(defn item-view [item owner {:keys [current-item event]}]
   (reify
     om/IRender
     (render [_]

    om/IInitState
    (init-state [_]
      {:current-item (chan)
       :sync (chan)})

    om/IWillMount
    (will-mount [_]

  (let [value (.. e -target -value)]
    (om/set-state! owner :text text)))

(defn search [owner {:keys [event current-item]}] ;; XXX: current-item really?
  (let [search (-> (om/get-node owner "search")
                   .-value)]
    (when (and search (not= search ""))
      (put! event {:op :search :data {:subs search}}))))

(defn search-view [items owner {:keys [current-item event]}]
  (reify
    om/IRenderState
    (render-state [_ state]
      (let [opts {:current-item current-item ;;; XXX
                  :event event}]
        (dom/div #js {:id "search-view"}
                 (dom/p nil "Currently only title's are searchable. It
                 might take a few seconds before entries are
