|
@@ -3,28 +3,26 @@
|
|
|
[frontend.state :as state]
|
|
[frontend.state :as state]
|
|
|
[frontend.util :as util]))
|
|
[frontend.util :as util]))
|
|
|
|
|
|
|
|
-(def state-store (atom {}))
|
|
|
|
|
-
|
|
|
|
|
(defn state-f [k]
|
|
(defn state-f [k]
|
|
|
- (fn [] (get @state-store k)))
|
|
|
|
|
|
|
+ (fn [] (get @state/components k)))
|
|
|
|
|
|
|
|
(defn bind-state [k]
|
|
(defn bind-state [k]
|
|
|
{:after-render
|
|
{:after-render
|
|
|
(fn [state]
|
|
(fn [state]
|
|
|
(js/setTimeout
|
|
(js/setTimeout
|
|
|
(fn []
|
|
(fn []
|
|
|
- (swap! state-store assoc k state))
|
|
|
|
|
|
|
+ (swap! state/components assoc k state))
|
|
|
100)
|
|
100)
|
|
|
state)
|
|
state)
|
|
|
|
|
|
|
|
:did-remount
|
|
:did-remount
|
|
|
(fn [_ new-state]
|
|
(fn [_ new-state]
|
|
|
- (swap! state-store assoc k new-state)
|
|
|
|
|
|
|
+ (swap! state/components assoc k new-state)
|
|
|
new-state)
|
|
new-state)
|
|
|
|
|
|
|
|
:will-unmount
|
|
:will-unmount
|
|
|
(fn [state]
|
|
(fn [state]
|
|
|
- (swap! state-store dissoc k)
|
|
|
|
|
|
|
+ (swap! state/components dissoc k)
|
|
|
state)})
|
|
state)})
|
|
|
|
|
|
|
|
(defn before [f shortcut-map]
|
|
(defn before [f shortcut-map]
|