   [db path]
   (reaction (get-in @db path)))
 
-(register-sub :tabs general-query)
-(register-sub :groups general-query)
+(register-sub :data general-query)
+(register-sub :state general-query)
 
 
 ;;;;----------------------------

      ]]))

(defn tab-groups []
  (let [tab-groups (subscribe [:groups])]
    (fn []
      [:div
       [:div {:class "page-header"} [:h2 "Previous groups"]]

  :initialize
  (fn [_ [_ tabs]]
    (.log js/console tabs)
    (console/trace "Initializing with:" tabs)
    (go (dispatch [:storage-loaded (<! (storage/get))]))
    {:data {:tabs tabs}}))

(register-handler
  :storage-loaded
  (fn [app-state [_ data]]
    (console/trace "Storage loaded:" data)
    (assoc-in app-state [:data :groups] (:groups data))
    ))

(register-handler
  :tab-created
  (fn [app-state [_ msg]]
    (console/trace "Created" (:tab msg))
    (assoc app-state [:data :tabs] (conj (get-in app-state [:data :tabs]) (:tab msg)))))

(defn remove-tab
  "Removed a tab from a collection by id"
