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:
parent
e741678f2a
commit
380aaab806
3 changed files with 5 additions and 23 deletions
|
@ -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)
|
||||
|
|
|
@ -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)))))
|
||||
|
||||
|
|
|
@ -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))
|
||||
|
|
Loading…
Reference in a new issue