mirror of
https://github.com/penpot/penpot.git
synced 2026-09-14 07:59:36 +00:00
Add implementation of UpdateEvent for function.
Just for make easy implement pure state transformation events just using plain functions, without reify.
This commit is contained in:
parent
b3f3d51dae
commit
e59605ec11
@ -44,6 +44,11 @@
|
|||||||
[e]
|
[e]
|
||||||
(satisfies? EffectEvent e))
|
(satisfies? EffectEvent e))
|
||||||
|
|
||||||
|
(extend-protocol UpdateEvent
|
||||||
|
function
|
||||||
|
(-apply-update [func state]
|
||||||
|
(func state)))
|
||||||
|
|
||||||
(defonce bus (rx/bus))
|
(defonce bus (rx/bus))
|
||||||
|
|
||||||
(defn emit!
|
(defn emit!
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user