0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-09 16:30:37 -05:00

Avoid persist page operation on first workspace loading.

This commit is contained in:
Andrey Antukh 2016-03-19 19:24:47 +02:00
parent e050c16f9a
commit b37d3a21b7
2 changed files with 7 additions and 3 deletions

View file

@ -29,4 +29,6 @@
(defn init
"Initialize the state materialization."
[]
(rx/to-atom stream state))
(as-> stream $
(rx/dedupe $)
(rx/to-atom $ state)))

View file

@ -34,8 +34,9 @@
(l/focus-atom $ st/state)))
(defn on-page-change
[page]
(rs/emit! (udp/update-page page)))
[buffer]
(let [page (second buffer)]
(rs/emit! (udp/update-page page))))
(defn subscribe-to-page-changes
[pageid]
@ -43,6 +44,7 @@
(rx/from-atom $)
(rx/dedupe #(dissoc % :version) $)
(rx/debounce 1000 $)
(rx/buffer 2 1 $)
(rx/subscribe $ on-page-change #(throw %))))
(defn- workspace-will-mount