(comp-middleware v)
Given a vector of middleware, filter out any nils, and use "comp" to compose the elements. v can have nested vectors, and will be flattended before "comp" is applied. For convienience, if v a function (assumed to be middleware already), just return it. Filtering out nils allows us to create Middlewhere conditionally like this: (comp-middleware [pure (when debug? debug)]) ;; that 'when' might leave a nil
Given a vector of middleware, filter out any nils, and use "comp" to compose the elements. v can have nested vectors, and will be flattended before "comp" is applied. For convienience, if v a function (assumed to be middleware already), just return it. Filtering out nils allows us to create Middlewhere conditionally like this: (comp-middleware [pure (when debug? debug)]) ;; that 'when' might leave a nil
(handle event-v)
Given an event vector, look up the handler, then call it. By default, handlers are not assumed to be pure. They are called with two paramters:
app-db
atom andGiven an event vector, look up the handler, then call it. By default, handlers are not assumed to be pure. They are called with two paramters: - the `app-db` atom and - the event vector The handler is assumed to side-effect on the given atom, the return value is ignored. To write pure handlers, use the "pure" middleware when registering the handler.
(lookup-handler event-id)
(register-base event-id handler-fn)
(register-base event-id middleware handler-fn)
register a handler for an event. This is low level and it is expected that "register-handler" would generally be used, see re-frame.core.
register a handler for an event. This is low level and it is expected that "register-handler" would generally be used, see re-frame.core.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close