From e59605ec11afc9d79ad4292dbf50a3ce55600d99 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Wed, 24 Feb 2016 17:19:40 +0200 Subject: [PATCH] Add implementation of UpdateEvent for function. Just for make easy implement pure state transformation events just using plain functions, without reify. --- src/uxbox/rstore.cljs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/uxbox/rstore.cljs b/src/uxbox/rstore.cljs index fb160e7d7..74f2cb12a 100644 --- a/src/uxbox/rstore.cljs +++ b/src/uxbox/rstore.cljs @@ -44,6 +44,11 @@ [e] (satisfies? EffectEvent e)) +(extend-protocol UpdateEvent + function + (-apply-update [func state] + (func state))) + (defonce bus (rx/bus)) (defn emit!