mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49: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]
|
(defrecord ImagesFetched [coll-id items]
|
||||||
rs/UpdateEvent
|
rs/UpdateEvent
|
||||||
(-apply-update [_ state]
|
(-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
|
(defn images-fetched
|
||||||
[coll-id items]
|
[coll-id items]
|
||||||
(ImagesFetched. coll-id items))
|
(ImagesFetched. coll-id items))
|
||||||
|
|
||||||
;; --- Load Images
|
;; --- Fetch Images
|
||||||
|
|
||||||
(defrecord FetchImages [coll-id]
|
(defrecord FetchImages [coll-id]
|
||||||
rs/WatchEvent
|
rs/WatchEvent
|
||||||
|
|
Loading…
Add table
Reference in a new issue