 (def ^:private dispatch-chan  (chan))
 
 (defn dispatch
-  "reagent components send events by calling this function.
+  "components send events by calling this function.
   Usage example:
      (dispatch [:delete-item 42])"
   [event-v]

  (go-loop []
      (let [event-v     (<! dispatch-chan)]
        (dispatch-sync event-v)
        (recur))))

(router)  ;; run the router loop it

  [event-v]
  (let [event-id    (first-in-vector event-v)
        handler-fn  (get @id->fn event-id)]
    (assert (some? handler-fn) (str "No event handler registered for event: " event-id ))
    (handler-fn app-db event-v)))


