0
Fork 0
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:
Andrey Antukh 2016-10-03 23:09:55 +02:00
parent 81c9794657
commit e017975162
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95

View file

@ -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