 
 (enable-console-print!)
 
+; Storages
+
 (def local-storage js/localStorage)
 (def session-storage js/sessionStorage)
+
+; Serialization & deserialization
 
 (defmulti serialize type)
 (defmethod serialize :default


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

  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))
