(debug handler)
Middleware which logs debug information to js/console for each event. Includes a clojure.data/diff of the db, before vs after, showing changes.
Middleware which logs debug information to js/console for each event. Includes a clojure.data/diff of the db, before vs after, showing changes.
(noop handler)
Middleware which does nothing
Middleware which does nothing
(path p)
Supplies a sub-tree of db
to the handler. A narrowed view.
Assumes "pure" is in the middleware pipeline prior.
Grafts the result back into db.
Supplies a sub-tree of `db` to the handler. A narrowed view. Assumes "pure" is in the middleware pipeline prior. Grafts the result back into db.
(pure handler)
Acts as an adaptor, allowing handlers to be writen as pure functions. The re-frame router will pass in an atom as the first parameter. This middleware adapts that to the value within the atom. If you strip away the error/efficiency checks, this middleware is just: (reset! app-db (handler @app-db event-vec))
Acts as an adaptor, allowing handlers to be writen as pure functions. The re-frame router will pass in an atom as the first parameter. This middleware adapts that to the value within the atom. If you strip away the error/efficiency checks, this middleware is just: (reset! app-db (handler @app-db event-vec))
(trim-v handler)
Middleware which removes the first element of v. Its use means you can write more asthetically pleasing handlers. Your handlers will look like this: (defn my-handler [db [x y z]] ;; <-- instead of [_ x y z] ....)
Middleware which removes the first element of v. Its use means you can write more asthetically pleasing handlers. Your handlers will look like this: (defn my-handler [db [x y z]] ;; <-- instead of [_ x y z] ....)
(undoable handler)
Middleware which stores an undo checkpoint.
Middleware which stores an undo checkpoint.
(validate f)
Middleware factory which applies a given validation function "f" to db after the handler is finished. This validation function f, might further change db, by perhaps assoc-ing warnings and errors into db.
Middleware factory which applies a given validation function "f" to db after the handler is finished. This validation function f, might further change db, by perhaps assoc-ing warnings and errors into db.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close