   [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)
 
 
 ;;;;----------------------------

    (console/trace "Replaced:" msg)
    ; We don't need to create a new item for the tab being added, as
    ; we'll also get an "update" message which will add it.
    (assoc app-state :tabs (remove-tab (:tabs app-state) (:removed msg)))))


(register-handler
  :tabset-save
  (fn [app-state [_]]
    (let [tabs    (:tabs app-state)
          to-save (map (fn [m] (select-keys m [:index :url :id :title])) tabs)
          groups  (conj (or (:groups app-state) '())
                        (group-from-tabs to-save))]
      (storage/set {:groups groups})
      (assoc app-state :groups groups))
    ))



  :tab-updated
  (fn [app-state [_ msg]]
    (console/trace "Updated:" msg)
    (assoc-in app-state
      [:data :tabs]
      (-> (get-in app-state [:data :tabs])
          (remove-tab (:tabId msg))
          (conj (:tab msg))))
    ))
