Replace builtin rstore impl with potok.

This commit is contained in:
Andrey Antukh 2016-11-27 21:53:12 +01:00
parent 6f8f115422
commit 40b48318ff
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
92 changed files with 965 additions and 1063 deletions

View file

@ -8,8 +8,8 @@
(:require [sablono.core :refer-macros [html]]
[lentes.core :as l]
[beicon.core :as rx]
[uxbox.util.rstore :as rs]
[uxbox.main.state :as st]
[potok.core :as ptk]
[uxbox.store :as st]
[uxbox.main.data.shapes :as uds]
[uxbox.main.ui.keyboard :as kbd]
[uxbox.main.ui.workspace.base :as wb]
@ -41,10 +41,10 @@
(rx/filter #(= % :mouse/up))
(rx/take 1))
stream (rx/take-until stoper wb/mouse-delta-s)
on-move #(rs/emit! (uds/move-shape shape %))
on-move #(st/emit! (uds/move-shape shape %))
on-stop #(rlocks/release! :shape/move)]
(when @wb/alignment-ref
(rs/emit! (uds/initial-align-shape shape)))
(st/emit! (uds/initial-align-shape shape)))
(rx/subscribe stream on-move nil on-stop)))]
(rlocks/acquire! :shape/move)
@ -65,16 +65,16 @@
(and (not selected?) (empty? selected))
(do
(dom/stop-propagation event)
(rs/emit! (uds/select-shape id))
(st/emit! (uds/select-shape id))
(start-move))
(and (not selected?) (not (empty? selected)))
(do
(dom/stop-propagation event)
(if (kbd/shift? event)
(rs/emit! (uds/select-shape id))
(st/emit! (uds/select-shape id))
(do
(rs/emit! (uds/deselect-all)
(st/emit! (uds/deselect-all)
(uds/select-shape id))
(start-move))))