Liking cljdoc? Tell your friends :D

re-frame.handlers


*handling*cljs

source

clear-handlers!cljs

(clear-handlers!)

Unregister all event handlers

Unregister all event handlers
sourceraw docstring

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 flattened before "comp" is applied. For convienience, if v is a function (assumed to be middleware already), just return it. Filtering out nils allows us to create Middleware 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 flattened before "comp" is applied.
For convienience, if v is a function (assumed to be middleware already), just return it.
Filtering out nils allows us to create Middleware conditionally like this:
   (comp-middleware [pure (when debug? debug)])  ;; that 'when' might leave a nil
sourceraw 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
  • the event vector The handler is assumed to side-effect on app-db - the return value is ignored. To write a pure handler, 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
  - the event vector
The handler is assumed to side-effect on `app-db` - the return value is ignored.
To write a pure handler, use the "pure" middleware when registering the handler.
sourceraw docstring

lookup-handlercljs

(lookup-handler event-id)
source

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 "re-frame.core/register-handler" would generally be used.

register a handler for an event.
This is low level and it is expected that "re-frame.core/register-handler" would
generally be used.
sourceraw docstring

report-middleware-factoriescljs

(report-middleware-factories v)
See https://github.com/Day8/re-frame/issues/65
sourceraw docstring

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

× close