Liking cljdoc? Tell your friends :D

re-frame-lib.core


->interceptorclj/s

source

add-post-event-callbackclj/s

(add-post-event-callback state f)
(add-post-event-callback state id f)

Registers a function f to be called after each event is processed f will be called with two arguments:

  • event: a vector. The event just processed.
  • queue: a PersistentQueue, possibly empty, of events yet to be processed.

This is useful in advanced cases like:

  • you are implementing a complex bootstrap pipeline
  • you want to create your own handling infrastructure, with perhaps multiple handlers for the one event, etc. Hook in here.
  • libraries providing 'isomorphic javascript' rendering on Nodejs or Nashorn.

'id' is typically a keyword. Supplied at "add time" so it can subsequently be used at "remove time" to get rid of the right callback.

Registers a function `f` to be called after each event is processed
`f` will be called with two arguments:
- `event`: a vector. The event just processed.
- `queue`: a PersistentQueue, possibly empty, of events yet to be processed.

This is useful in advanced cases like:
- you are implementing a complex bootstrap pipeline
- you want to create your own handling infrastructure, with perhaps multiple
handlers for the one event, etc.  Hook in here.
- libraries providing 'isomorphic javascript' rendering on  Nodejs or Nashorn.

'id' is typically a keyword. Supplied at "add time" so it can subsequently
be used at "remove time" to get rid of the right callback.
sourceraw docstring

add-state-defaultsclj/s

(add-state-defaults state)

Adds to the re-frame state some builtin handlers, like coeffects, effects, etc.

Adds to the re-frame state some builtin handlers, like coeffects, effects,
etc.
sourceraw docstring

afterclj/s

source

assoc-coeffectclj/s

source

assoc-effectclj/s

source

clear-cofxclj/s

source

clear-eventclj/s

source

clear-fxclj/s

source

clear-subclj/s

source

clear-subscription-cache!clj/s

source

consoleclj/s

source

debugclj/s

source

dispatchclj/s

source

dispatch-syncclj/s

source

empty-db?clj/s

(empty-db? st)

Checks if the app-db atom is empty. Useful for figwheel.

Checks if the app-db atom is empty. Useful for figwheel.
sourceraw docstring

enqueueclj/s

source

enrichclj/s

source

get-coeffectclj/s

source

get-effectclj/s

source

inject-cofxclj/s

source

make-restore-fnclj/s

(make-restore-fn state)

Checkpoints the state of re-frame and returns a function which, when later called with current-state, will restore re-frame to that checkpointed state.

Checkpoint includes app-db, all registered handlers and all subscriptions.

Checkpoints the state of re-frame and returns a function which, when
later called with current-state, will restore re-frame to that
checkpointed state.

Checkpoint includes app-db, all registered handlers and all subscriptions.
sourceraw docstring

new-stateclj/s

(new-state)

Creates a new re-frame state. This is the one to use. Once created, you can create subscriptions and events handlers using the -> threading macro:

(defonce state (-> (new-state) subs/reg-some-subs events/reg-some-events)))

or you can reload the handlers (if (empty-db? state) (swap! astate #(-> % subs/reg-some-subs events/reg-some-events)))

Creates a new re-frame `state`. This is the one to use.
Once created, you can create subscriptions and events handlers using the ->
threading macro:

(defonce state
  (-> (new-state)
      subs/reg-some-subs
      events/reg-some-events)))

or you can reload the handlers
(if (empty-db? state)
  (swap! astate #(-> % subs/reg-some-subs events/reg-some-events))) 
sourceraw docstring

new-state-wo-event-queueclj/s

(new-state-wo-event-queue)
source

on-changesclj/s

source

pathclj/s

source

purge-event-queueclj/s

(purge-event-queue state)

Remove all events queued for processing

Remove all events queued for processing
sourceraw docstring

reg-cofxclj/s

source

reg-event-ctxclj/s

(reg-event-ctx state id handler)
(reg-event-ctx state id interceptors handler)

Register the given event handler (function) for the given id. Optionally, provide an interceptors chain. id is typically a namespaced keyword (but can be anything) handler is a function: (context-map event-vector) -> context-map

This form of registration is almost never used.

Register the given event `handler` (function) for the given `id`. Optionally, provide
an `interceptors` chain.
`id` is typically a namespaced keyword  (but can be anything)
`handler` is a function: (context-map event-vector) -> context-map

This form of registration is almost never used. 
sourceraw docstring

reg-event-dbclj/s

(reg-event-db state id handler)
(reg-event-db state id interceptors handler)

Register the given event handler (function) for the given id. Optionally, provide an interceptors chain. id is typically a namespaced keyword (but can be anything) handler is a function: (db event) -> db interceptors is a collection of interceptors. Will be flattened and nils removed. handler is wrapped in its own interceptor and added to the end of the interceptor chain, so that, in the end, only a chain is registered. Special effects and coeffects interceptors are added to the front of this chain.

Register the given event `handler` (function) for the given `id`. Optionally, provide
an `interceptors` chain.
`id` is typically a namespaced keyword  (but can be anything)
`handler` is a function: (db event) -> db
`interceptors` is a collection of interceptors. Will be flattened and nils removed.
`handler` is wrapped in its own interceptor and added to the end of the interceptor
 chain, so that, in the end, only a chain is registered.
 Special effects and coeffects interceptors are added to the front of this
 chain.
sourceraw docstring

reg-event-fxclj/s

(reg-event-fx state id handler)
(reg-event-fx state id interceptors handler)

Register the given event handler (function) for the given id. Optionally, provide an interceptors chain. id is typically a namespaced keyword (but can be anything) handler is a function: (coeffects-map event-vector) -> effects-map interceptors is a collection of interceptors. Will be flattened and nils removed. handler is wrapped in its own interceptor and added to the end of the interceptor chain, so that, in the end, only a chain is registered. Special effects and coeffects interceptors are added to the front of the interceptor chain. These interceptors inject the value of app-db into coeffects, and, later, action effects.

Register the given event `handler` (function) for the given `id`. Optionally, provide
an `interceptors` chain.
`id` is typically a namespaced keyword  (but can be anything)
`handler` is a function: (coeffects-map event-vector) -> effects-map
`interceptors` is a collection of interceptors. Will be flattened and nils removed.
`handler` is wrapped in its own interceptor and added to the end of the interceptor
 chain, so that, in the end, only a chain is registered.
 Special effects and coeffects interceptors are added to the front of the
 interceptor chain.  These interceptors inject the value of app-db into coeffects,
 and, later, action effects.
sourceraw docstring

reg-fxclj/s

source

reg-subclj/s

source

reg-sub-rawclj/s

(reg-sub-raw state query-id handler-fn)

This is a low level, advanced function. You should probably be using reg-sub instead. Docs in https://github.com/Day8/re-frame/blob/master/docs/SubscriptionFlow.md

This is a low level, advanced function.  You should probably be
using reg-sub instead.
Docs in https://github.com/Day8/re-frame/blob/master/docs/SubscriptionFlow.md
sourceraw docstring

remove-post-event-callbackclj/s

(remove-post-event-callback state id)
source

set-loggers!clj/s

source

state?clj/s

source

subscribeclj/s

source

trim-vclj/s

source

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

× close