                        nil
                        (dom/a
                          #js {:href "#"
-                              :onClick (fn [ev] ((:handler data)
-                                                 {:stream (:stream %)}))}
+                              :onClick (fn [ev]
+                                         ((:handler data)
+                                          {:stream (:stream %)}))}
                          (:stream %)))
                     (:streams state)))))))
+
+(defn event-list-item [params]
+  (reify
+    om/IRender
+    (render [_]
+      (let [event (:event params)
+            data (:data params)
+            payload (:payload event)
+            id (str (:service-id event) ":" (:local-id event))]
+        (dom/li
+            nil
+          (let [current? (= (:current data) id)]
+            (dom/div
+                nil
+              (dom/a
+                  #js {:href "#"
+                       :onClick
+                       (fn [ev] (if current?
+                                  (om/update! data :current nil)
+                                  (om/update! data :current id)))}
+                  id)
+              (if current?
+                (dom/pre
+                 nil
+                 (dom/code
+                  #js {:className "clojure"}
+                  (clj->str event)))))))))))
+
+(defn event-list [params owner]
+  (reify
+    om/IRender
+    (render [_]
+      (apply dom/ul
+          nil
+          (map #(om/build event-list-item {:data (:data params)
+                                           :event %})
+               (:events params))))))
 
 (defn widget-stream [data owner]
   (reify

      {:events []})
    om/IDidMount
    (did-mount [this]
      (go (let [response (:body (<! (client/get (str "/stream/" (:stream data)))))]
            (om/update-state! owner #(assoc % :events (:results response))))))
    om/IDidUpdate
    (did-update [_ _ _]
      (dorun (map #(.highlightBlock js/hljs %) ($ "code"))))

                      #js {:contentEditable "true"
                           :ref "code-box"
                           :className "clojure"
                           :onBlur
                           (fn [ev]
                             (om/update! data :reduction
                                         (.-textContent (.-target ev)))
                             (update-box owner "code-box"))}
                      (:reduction data))))
        (dom/div
          nil
          (dom/button
              #js {:onClick
                   (fn [_]
                     (go
                       (let [res
                             (:body
                              (<! (client/post
                                   "/projections"
                                   {:json-params
                                    (select-keys data
                                                 [:projection-name
                                                  :stream-name
                                                  :initial-value
                                                  :reduction
                                                  :language])})))]
                         (update-projections! data))))}
              "Register projection"))))))

(defn widget-projections [data owner]
  (reify
