 
 
 
-;;;;
-;;;; Helpers
-;;;;
-
-(defn set-cookie [k v]
-  (aset js/document "cookie" (str (name k) "=" v)))
-
-(defn get-cookie [k]
-  (let [cookie (aget js/document "cookie")
-        as-map (->> (split cookie #";")
-                    (map trim)
-                    (map #(split % #"="))
-                    (map #(if (= 1 (count %))
-                           [(first %) nil]
-                           %))
-                    (into {})
-                    (clojure.walk/keywordize-keys))]
-    (k as-map)))
-
-
 ;;;;------------------------------
 ;;;; Queries
 ;;;;------------------------------

(register-handler
  :initialize
  (fn [app-state _]
    (dispatch [:set-token (get-cookie :token)])
    (merge app-state {:ui-state {:is-busy?      false
                                 :section       :login
                                 :current-query ""

(ns memento.core
  (:require [ajax.core :refer [GET POST PUT]]
            [clojure.string :refer [trim split]]
            [reagent.cookies :as cookies]
            [reagent.core :as reagent :refer [atom]]
            [re-frame.core :refer [dispatch register-sub register-handler subscribe dispatch-sync]]
            [goog.events :as events]
