mirror of
https://github.com/penpot/penpot.git
synced 2025-05-22 13:37:22 +02:00
Improve history handling on frontend.
This commit is contained in:
parent
691c359985
commit
94677f2f7e
11 changed files with 322 additions and 281 deletions
|
@ -57,13 +57,13 @@
|
|||
coll)))
|
||||
|
||||
(defn replace-by-id
|
||||
[coll value]
|
||||
{:pre [(vector? coll)]}
|
||||
(mapv (fn [item]
|
||||
([value]
|
||||
(map (fn [item]
|
||||
(if (= (:id item) (:id value))
|
||||
value
|
||||
item)) coll))
|
||||
|
||||
item))))
|
||||
([coll value]
|
||||
(sequence (replace-by-id value) coll)))
|
||||
|
||||
(defn deep-merge
|
||||
"Like merge, but merges maps recursively."
|
||||
|
@ -80,6 +80,16 @@
|
|||
(disj s v)
|
||||
(conj s v)))
|
||||
|
||||
(defn seek
|
||||
([pred coll]
|
||||
(seek pred coll nil))
|
||||
([pred coll not-found]
|
||||
(reduce (fn [_ x]
|
||||
(if (pred x)
|
||||
(reduced x)
|
||||
not-found))
|
||||
not-found coll)))
|
||||
|
||||
;; --- String utils
|
||||
|
||||
(def +uuid-re+
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue