diff --git a/src/re_frame/core.cljs b/src/re_frame/core.cljs index 156c8ad..1048529 100644 --- a/src/re_frame/core.cljs +++ b/src/re_frame/core.cljs @@ -21,7 +21,7 @@ (def path middleware/path) (def validate middleware/validate) (def log-events middleware/log-events) -(def apply-event middleware/apply-event) +(def trim-v middleware/trim-v) @@ -32,4 +32,4 @@ ([id handler] (register-handler id pure handler)) ([id middleware handler] - (register-handler id (comp pure middleware) handler))) + (register-handler id [pure middleware] handler))) diff --git a/src/re_frame/handlers.cljs b/src/re_frame/handlers.cljs index 2877ea9..f9b662c 100644 --- a/src/re_frame/handlers.cljs +++ b/src/re_frame/handlers.cljs @@ -19,7 +19,11 @@ (swap! id->fn assoc event-id handler-fn)) ([event-id middleware handler-fn] - (register event-id (middleware handler-fn)))) + (let [mware (if (vector? middleware) + (apply comp middleware) ;; compose the vector of middleware + middleware) + hander-fn (mware handler-fn)] + (register event-id hander-fn)))) ;; -- The Event Conveyor Belt --------------------------------------------------------------------