 
   (assoc! local-storage {:foo :bar} (js/Date.))
   (assert (= 1 (count local-storage)))
-  (assert (= 0 (count session-storage))))
+  (assert (contains? local-storage {:foo :bar}))
+  (assert (= 0 (count session-storage)))
+)


(enable-console-print!)

(def local-storage js/localStorage)
(def session-storage js/sessionStorage)

(defmulti serialize type)
(defmethod serialize :default

  ILookup
  (-lookup
    ([s key]
       (some->
        (.getItem s (serialize key))
        deserialize))
    ([s key not-found]
       (if-let [i (.getItem s (serialize key))]
         (deserialize i)
         not-found)))
)

(defn clear! [storage] (.clear storage))
