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

  Object
  (render [this]
          (apply dom/ul nil
                 (map (fn [country]
                        (dom/li nil country)
                        )
                      )
                 )

;; Processing the initial URL

(def initial-url
  (parse-url-hash
    js/window.location.hash
    )
  )

(def initial-tab
  (get-tab-by-parsed-url tabs initial-url)
  )

(def initial-component
  (:component initial-tab)
  )

(def initial-query-for-root
  (when initial-component
    (om/query initial-component)
    )
  )

(def initial-params-for-root
  (when initial-component
    (om/params initial-component)
    )
  )

;; Components

(defui RootView
  static om/IQueryParams
  (params [_]
          initial-params-for-root ; here and below, we're passing (pre-computed) value
                                  ; and not doing function calls
    )

  static om/IQuery
  (query [_]
         initial-query-for-root
    )

  Object
  (render [this]
          (let []
            (dom/div #js {:className "container"}
                     ;; Tabs (navigation)
                        (apply dom/ul
                        #js
                        {:className "nav nav-tabs", :role "tablist"}
                        (map (fn [tab]
                        (dom/li
                          #js
                          {:className "active", :role "presentation"}
                          (dom/a
                          #js
                          {:shape "rect",
                            :href "#home",
                            :aria-controls "home",
                            :role "tab",
                            :data-toggle "tab"}
                          (:title tab))))
                             tabs))
                    )
            )
          )
  )

