 ; Constants
 ;
 (def ^:const DATEFORMAT "d.M.yyyy H:mm")
-
+(declare serialize-md)
+(declare serialize-edn)
+(declare querydb)
+
+;; Utils
+
+(defn format_time [d format]
+  "Render instance of js/Date according to format"
+  (let [format (new goog.i18n.DateTimeFormat format)]
+    (.format format d)))
+
+(defn blob?
+  [item]
+  (if (= (get item "type") "blob") true false))
+
+(defn editing?
+  [pos]
+  (contains? (querydb [:editing]) pos))
+
+(defn opened?
+  [pos]
+  (contains? (querydb [:opened]) pos))
 
 ;; Transito functions
 

         :start 0
         :editing #{}
         :opened #{}
         :serialized false})

(defn ^:export updatedb [fields value]
  (set! db (assoc-in db fields value))

  (if (querydb [:serialized])
    (updatedb [:serialized] false)
    (updatedb [:serialized] true)))

(defn set_serialize
  [serializer]
  (updatedb [:serializer] serializer))

;; App

