                                  ])
                     #(string/split % "=")) (string/split params "&")))
       ]
-  {:path path
-   :params params}
-  )
+    {:path path
+     :params params}
+    )
+  )
+
+(defn path-and-params-to-hash
+  "Opposite for function from above. Expects keys of `params` to be keywords"
+  ([path]
+   (path-and-params-to-hash nil)
+   )
+  ([path params]
+    (apply str "#/" (string/join "/" path) "/"
+         (when params
+           (cons
+             "?"
+            (string/join "&" (map (fn [[k v]]
+                                    (str
+                                      (-> k name js/encodeURIComponent)
+                                      "="
+                                      (-> v js/encodeURIComponent)
+                                      )
+                                    ) params))
+            )
+           )
+         )
+   )
+  )
+
+;; Tab functions
+
+(defn get-tab-by-parsed-url [tabs {:keys [path params]}]
+  "Tabs format is defined in `tabs` below. See `parse-url-hash` for second param"
+  (first (filter
+           #(= (:url-path %) path)
+           tabs))
   )
 
 

;; Processing the initial URL

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

(

;; Components

(defui RootView
  static om/IQueryParams
  (params [_]
    )

  static om/IQuery
  (query [_]
    )

  Object
  (render [this]
    (dom/div #js {:className "container"}
             "Hello, world!"
             )
          )
  )


(defui CountriesTab
  static om/IQueryParams
  (params [_]
          {:page 1}
          )

  static om/IQuery
