mirror of
https://github.com/penpot/penpot.git
synced 2025-01-24 23:49:45 -05:00
Minor renames on rstore impl.
This commit is contained in:
parent
abd68ad2e9
commit
e9a51c14b8
1 changed files with 5 additions and 3 deletions
|
@ -66,7 +66,7 @@
|
|||
([event & events]
|
||||
(run! #(rx/push! bus %) (into [event] events))))
|
||||
|
||||
(defn swap-state
|
||||
(defn swap
|
||||
"A helper for just apply some function to state
|
||||
without a need to declare additional event."
|
||||
[f]
|
||||
|
@ -75,7 +75,7 @@
|
|||
(-apply-update [_ state]
|
||||
(f state))))
|
||||
|
||||
(defn reset-state
|
||||
(defn reset
|
||||
"A event that resets the internal state with
|
||||
the provided value."
|
||||
[state]
|
||||
|
@ -84,6 +84,8 @@
|
|||
(-apply-update [_ _]
|
||||
state)))
|
||||
|
||||
(enable-console-print!)
|
||||
|
||||
(defn init
|
||||
"Initializes the stream event loop and
|
||||
return a stream with model changes."
|
||||
|
@ -108,5 +110,5 @@
|
|||
(rx/subscribe $ (fn [[event model]] (-apply-effect event model))))
|
||||
|
||||
;; Initialize the stream machinary with initial state.
|
||||
(emit! (swap-state (fn [s] (merge s state))))
|
||||
(emit! (swap #(merge % state)))
|
||||
state-s))
|
||||
|
|
Loading…
Add table
Reference in a new issue