(as-task)
(as-task name-or-task)
(as-task name-or-task fxs)
Creates an interceptor to mark an event as task.
Give it a name of the task or map with at least a :name
key or nil / nothing to use the event name.
Tasks can be used via subscriptions ::tasks
and ::running?
.
Given vector fxs
will be used to identify effects to monitor for the task. Can be the keyword of the effect or an vector of effects path (to handle special :fx effect). Completion keys must be set by set-completion-keys-per-effect!
or merge-completion-keys-per-effect!
for the effects.
Within your event handler use ::task
as effect to modify your task data.
Works in combination with https://github.com/jtkDvlp/re-frame-async-coeffects. For async coeffects there is no need to define what to monitor. Coeffects will be monitored automatically.
Creates an interceptor to mark an event as task. Give it a name of the task or map with at least a `:name` key or nil / nothing to use the event name. Tasks can be used via subscriptions `::tasks` and `::running?`. Given vector `fxs` will be used to identify effects to monitor for the task. Can be the keyword of the effect or an vector of effects path (to handle special :fx effect). Completion keys must be set by `set-completion-keys-per-effect!` or `merge-completion-keys-per-effect!` for the effects. Within your event handler use `::task` as effect to modify your task data. Works in combination with https://github.com/jtkDvlp/re-frame-async-coeffects. For async coeffects there is no need to define what to monitor. Coeffects will be monitored automatically.
(assoc-original-event event original-event)
Assoc original-event
to task if event
is ::unregister-and-dispatch-original
and its original is nil.
Assoc `original-event` to task if `event` is `::unregister-and-dispatch-original` and its original is nil.
Merge completion keys per effect.
Merge completion keys per effect.
(register db {:keys [:jtk-dvlp.re-frame.tasks/id] :as task})
Register task within app state. Also see event ::register
.
Tasks can be used via subscriptions ::tasks
and ::running?
.
Register task within app state. Also see event `::register`. Tasks can be used via subscriptions `::tasks` and `::running?`.
Sets completion keys per effect.
Sets completion keys per effect.
(unregister db id-or-task)
Unregister task within app state. Also see event ::unregister
and ::unregister-and-dispatch-original
.
Tasks can be used via subscriptions ::tasks
and ::running?
.
Unregister task within app state. Also see event `::unregister` and `::unregister-and-dispatch-original`. Tasks can be used via subscriptions `::tasks` and `::running?`.
(update-original-event event f & args)
Update original event of task if event
is ::unregister-and-dispatch-original
.
Update original event of task if `event` is `::unregister-and-dispatch-original`.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close