Return nil when registering a handler

This commit is contained in:
Daniel Compton 2016-07-26 16:09:56 +12:00
parent 6df7320f97
commit 0ce1a04930
1 changed files with 5 additions and 4 deletions

View File

@ -64,7 +64,8 @@
([event-id handler-fn]
(when (contains? @id->fn event-id)
(console :warn "re-frame: overwriting an event-handler for: " event-id)) ;; allow it, but warn.
(swap! id->fn assoc event-id handler-fn))
(swap! id->fn assoc event-id handler-fn)
nil)
([event-id middleware handler-fn]
(let [mid-ware (comp-middleware middleware) ;; compose the middleware