diff --git a/src/uxbox/data/pages.cljs b/src/uxbox/data/pages.cljs index a534121a01..0c9339836e 100644 --- a/src/uxbox/data/pages.cljs +++ b/src/uxbox/data/pages.cljs @@ -188,7 +188,7 @@ rs/WatchEvent (-apply-watch [_ state s] (letfn [(on-success [_] - (rs/swap #(stpr/purge-page % id)))] + #(stpr/purge-page % id))] (->> (rp/req :delete/page id) (rx/map on-success) (rx/tap callback) diff --git a/src/uxbox/data/projects.cljs b/src/uxbox/data/projects.cljs index 3dc2bccd4e..35ef5e9066 100644 --- a/src/uxbox/data/projects.cljs +++ b/src/uxbox/data/projects.cljs @@ -117,7 +117,7 @@ rs/WatchEvent (-apply-watch [_ state s] (letfn [(on-success [_] - (rs/swap #(stpr/dissoc-project % id)))] + #(stpr/dissoc-project % id))] (->> (rp/req :delete/project id) (rx/map on-success))))) diff --git a/src/uxbox/rstore.cljs b/src/uxbox/rstore.cljs index a24983101a..ac7ce9fd45 100644 --- a/src/uxbox/rstore.cljs +++ b/src/uxbox/rstore.cljs @@ -67,26 +67,8 @@ ([event & events] (run! emit! (cons event events)))) -(defrecord SwapState [f] - UpdateEvent - (-apply-update [_ state] - (f state))) - -(defn swap - "A helper for just apply some function to state - without a need to declare additional event." - [f] - (->SwapState f)) - -(defn reset - "A event that resets the internal state with - the provided value." - [v] - (->SwapState (fn [_] v))) - -(enable-console-print!) - -(defonce ^:private error-handlers (atom {})) +(defonce ^:private error-handlers + (atom {})) (defn add-error-watcher [key callable] @@ -130,5 +112,5 @@ (rx/subscribe $ (fn [[event model]] (-apply-effect event model)))) ;; Initialize the stream machinary with initial state. - (emit! (swap #(merge % state))) + (emit! #(merge % state)) state-s))