 (defui RootView
   static om/IQueryParams
   (params [_]
-          ;initial-params ; here and below, we're passing (pre-computed) value
-          ;               ; and not doing function calls
-          (merge {}
-         (:params (get-query-and-params-by-parsed-url tabs (parse-url-hash
-                                               js/window.location.hash
-                                               )))
-                 )
+          initial-params ; here and below, we're passing (pre-computed) value
+                         ; and not doing function calls
     )
 
   static om/IQuery
   (query [_]
-         ;initial-query
-         (with-meta (:query (get-query-and-params-by-parsed-url tabs (parse-url-hash
-                                               js/window.location.hash
-                                               ))) nil)
+         initial-query
     )
 
   Object
   (componentDidMount [this]
                      (go-loop [new-query (<! routes-chan)]
-                                             (println "new query"
-                                                      new-query)
                                 (om/set-query!
                                   this
                                   new-query
                                   )
-
                               (recur (<! routes-chan))
                        )
                      )
 
   (render [this]
-          (let [unbound-query (om/query this)
-                unbound-params (om/params this)
+          (println "render called. and"
+                       (meta (first (-> this om/get-query)))
+                       (-> this om/get-query)
+                   (om/query this)
+                   (om/params this)
+                   )
+          (let [;unbound-query (om/query this)
+                ;unbound-params (om/params this)
                 query (om/get-query this)
                 tab-is-active (fn [tab]
-                                (= unbound-query
-                                   (om/query
-                                     (:component tab)
-                                     )
+                                (contains?
+                                  (into #{} (comp
+                                              (filter keyword?)
+                                              (filter #(= (namespace %) "tab-key"))
+                                              (map name)
+                                              (map keyword)
+                                             ) query)
+                                   (:key tab)
                                    )
                                 )
                 ]


(defmethod readf :default
  [{:keys [state] :as env} k params]
  (if-let [v (get @state k)]
    {:value v}
    {:value nil}


  static om/IQuery
  (query [_]
         '[:tab-key/countries
           (:countries {:page ?page})]
         )

  Object
