From 380aaab8066ed5babc3ee07043fa6c80a294dd45 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Sun, 29 May 2016 11:42:08 +0300 Subject: [PATCH] Remove unused swap and reset events declared in rstore ns. --- src/uxbox/data/pages.cljs | 2 +- src/uxbox/data/projects.cljs | 2 +- src/uxbox/rstore.cljs | 24 +++--------------------- 3 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/uxbox/data/pages.cljs b/src/uxbox/data/pages.cljs index a534121a0..0c9339836 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 3dc2bccd4..35ef5e906 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 a24983101..ac7ce9fd4 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))