mirror of
https://github.com/penpot/penpot.git
synced 2025-01-09 08:20:45 -05:00
Store images indexed in the state.
This commit is contained in:
parent
81c9794657
commit
e017975162
1 changed files with 5 additions and 2 deletions
|
@ -214,13 +214,16 @@
|
|||
(defrecord ImagesFetched [coll-id items]
|
||||
rs/UpdateEvent
|
||||
(-apply-update [_ state]
|
||||
(assoc-in state [:image-colls-by-id coll-id :images] (set items))))
|
||||
(reduce (fn [state {:keys [id] :as image}]
|
||||
(assoc-in state [:images-by-id id] image))
|
||||
state
|
||||
items)))
|
||||
|
||||
(defn images-fetched
|
||||
[coll-id items]
|
||||
(ImagesFetched. coll-id items))
|
||||
|
||||
;; --- Load Images
|
||||
;; --- Fetch Images
|
||||
|
||||
(defrecord FetchImages [coll-id]
|
||||
rs/WatchEvent
|
||||
|
|
Loading…
Reference in a new issue