0
Fork 0
mirror of https://github.com/penpot/penpot.git synced 2025-01-10 08:50:57 -05:00

Remove unused swap and reset events declared in rstore ns.

This commit is contained in:
Andrey Antukh 2016-05-29 11:42:08 +03:00
parent e741678f2a
commit 380aaab806
No known key found for this signature in database
GPG key ID: 4DFEBCB8316A8B95
3 changed files with 5 additions and 23 deletions

View file

@ -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)

View file

@ -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)))))

View file

@ -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))