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 them. v can have nested vectors, and will be flattended before "comp" is applied. For convienience, if v turns out to already be a function (assumed to be middleware), 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 them.
v can have nested vectors, and will be flattended before "comp" is applied.
For convienience, if v turns out to already be a function (assumed to be
middleware), 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
sourceraw docstring

dispatchcljs

(dispatch event-v)

Send an event to be processed by the registered handler.

Usage example: (dispatch [:delete-item 42])

Send an event to be processed by the registered handler.

Usage example:
   (dispatch [:delete-item 42])
sourceraw docstring

dispatch-synccljs

(dispatch-sync event-v)

Invoke the event handler sycronously, avoiding the async-inducing use of core.async/chan

Invoke the event handler sycronously, avoiding the async-inducing use of core.async/chan
sourceraw docstring

handlecljs

(handle event-v)

Given an event vector, look up the right 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 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 right 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 atom, the return value is ignored.
To write pure handlers, use the "pure" middleware when registering the handler.
sourceraw docstring

lookup-handlercljs

(lookup-handler event-id)
source

registercljs

(register event-id handler-fn)
(register event-id middleware handler-fn)

register a handler for an event

register a handler for an event
sourceraw docstring

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

× close