Liking cljdoc? Tell your friends :D

re-frame.handlers


comp-middlewarecljs

(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
raw docstring

handlecljs

(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:

  • 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.
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:
  - 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.
raw docstring

lookup-handlercljs

(lookup-handler event-id)

register-basecljs

(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.
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close