(reg-event-ctx id handler)
(reg-event-ctx 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.
(reg-event-db id handler)
(reg-event-db 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.
(reg-event-fx id fx-handler)
(reg-event-fx id interceptors fx-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.
(start-session & {:keys [teardown-event] :as options})
Starts a new re-serve session. Returns with a session-map
where new events
can be dispatched. Every session has it's own internal separate state-machine
where events are dispatched to.
Under the hood it listens on multiple core.asycn channnels and handles incoming
messages as events.
Optionally accepts an options
map where a teardown-event
could be defined. This
event will be the last event dispatched in a case of session stop.
The session can be stopped by calling stop-session
fn externally or by fireing an
effect :stop-session
.
Starts a new re-serve session. Returns with a `session-map` where new events can be dispatched. Every session has it's own internal separate state-machine where events are dispatched to. Under the hood it listens on multiple core.asycn channnels and handles incoming messages as events. Optionally accepts an `options` map where a `teardown-event` could be defined. This event will be the last event dispatched in a case of session stop. The session can be stopped by calling `stop-session` fn externally or by fireing an effect `:stop-session`.
(stop-session session-map)
Stops the session, all queued events will be handled, but newly
dispatched events are dropped. After the last event processed,
the teardown-event
-sepcified optionally in start-session
- is dispatched.
Stops the session, all queued events will be handled, but newly dispatched events are dropped. After the last event processed, the `teardown-event` -sepcified optionally in `start-session`- is dispatched.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close