Denormalize shapes storage.

This commit is contained in:
Andrey Antukh 2015-12-29 15:51:47 +02:00
parent 40bbc996f7
commit a4fe43235b
7 changed files with 40 additions and 23 deletions

View file

@ -27,6 +27,14 @@
(dp/project-pages % pid))) $
(l/focus-atom $ s/state)))
(def ^:static shapes-state
(as-> (ul/getter (fn [state]
(let [pid (get-in state [:workspace :page])
shapes (->> (vals (:shapes-by-id state))
(filter #(= (:page %) pid)))]
(into [] shapes)))) $
(l/focus-atom $ s/state)))
(def ^:static workspace-state
(as-> (l/in [:workspace]) $
(l/focus-atom $ s/state)))