mirror of
https://github.com/penpot/penpot.git
synced 2025-07-23 17:47:27 +02:00
🎉 Basic changes to use penpot as a library
This commit is contained in:
parent
10e0cf121b
commit
369dc8ffb5
11 changed files with 96 additions and 43 deletions
|
@ -6,6 +6,7 @@
|
|||
|
||||
(ns app.util.storage
|
||||
(:require
|
||||
[app.common.exceptions :as ex]
|
||||
[app.common.transit :as t]
|
||||
[app.util.globals :as g]
|
||||
[app.util.timers :as tm]))
|
||||
|
@ -38,7 +39,8 @@
|
|||
{}
|
||||
(range len)))))
|
||||
|
||||
|
||||
(defonce storage (atom (load (unchecked-get g/global "localStorage"))))
|
||||
;; Using ex/ignoring because can receive a DOMException like this when importing the code as a library:
|
||||
;; Failed to read the 'localStorage' property from 'Window': Storage is disabled inside 'data:' URLs.
|
||||
(defonce storage (atom (load (ex/ignoring (unchecked-get g/global "localStorage")))))
|
||||
|
||||
(add-watch storage :persistence #(persist js/localStorage %3 %4))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue