re-frame/src/re_frame/core.cljs

42 lines
956 B
Plaintext
Raw Normal View History

2015-02-25 11:03:02 +00:00
(ns re-frame.core
(:require
2015-02-25 11:03:25 +00:00
[re-frame.handlers :as handlers]
[re-frame.subs :as subs]
[re-frame.router :as router]
2015-03-01 20:58:34 +00:00
[re-frame.middleware :as middleware]))
2015-02-25 11:03:02 +00:00
;; -- API -------
(def register-handler handlers/register)
(def dispatch router/dispatch)
(def dispatch-sync router/dispatch-sync)
2015-02-25 11:03:02 +00:00
2015-02-26 03:24:50 +00:00
(def register-sub subs/register)
2015-02-25 11:03:02 +00:00
(def subscribe subs/subscribe)
(def pure middleware/pure)
2015-03-01 20:58:34 +00:00
(def debug middleware/debug)
2015-02-25 11:03:02 +00:00
(def undoable middleware/undoable)
(def path middleware/path)
(def validate middleware/validate)
(def trim-v middleware/trim-v)
(def after middleware/after)
2015-03-01 20:58:34 +00:00
; (def log-events middleware/log-events)
2015-02-25 11:03:02 +00:00
2015-03-02 14:03:09 +00:00
;; -- Convenience API -------
2015-02-25 11:03:02 +00:00
2015-03-02 14:03:09 +00:00
;; virtually every handler will be pure, ao make it easy
2015-02-25 11:03:02 +00:00
(defn register-pure-handler
([id handler]
(register-handler id pure handler))
([id middleware handler]
(register-handler id [pure middleware] handler)))