             [cljsjs.phoenix]
             [goog.events :as events]
             )
+  )
+
+(defn socket-opened [socket publisher v]
+  (println "dispatcher->socket-opened->v:" v)
+  )
+
+(defn generic-server-msg [socket v]
+  (println "dispatcher->generic-server-msg->v:" v)
+                                        ; (.send socket v)
+  )
+
+(defn user-logged-in [socket publisher v]
+  (println "dispatcher->user-logged-in->v:" v)
+  (when (:logged-in v)
+    ))
+
+;; TODO how do we connect to a different channel?
+;; TODO log in should id the shop
+;; TODO one per shop
+;; TODO we need an login for a channel
+(defn login-to-channel[]
   )
 
 (defn receive-ok [params]

      (startup cursor owner))
    om/IDidMount
    (did-mount [_]
      (let [publication (:publication (om/get-shared owner))
            server-message-events (sub publication :server-msg (chan))
            dispatcher-events (sub publication :dispatcher (chan))

  )

;; call close on the channel or the socket?
;; TODO Close sockets and channels?
(defn ^:private shutdown
  "Tears down the web socket connection."
  [{:keys [socket]}]
                                        ; (.close socket)
  )

;; this is where we do the socket connection
(defn ^:private make-init-state
  "Creates the initial state for the web socket widget.  In particular, this
  instantiates a WebSocket instance and creates a core.async channel for
