(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-orignal-event event original-event)Assocs original-event within maybe task event, returns maybe modified event.
Assocs `original-event` within maybe task `event`, returns maybe modified `event`.
(ensure-original-event event original-event)Ensures original-event for direct use or with task.
Ensures `original-event` for direct use or with task.
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.
(some-original-event? event)Checks for some original event of task or event itself.
Checks for some original event of task or `event` itself.
(task-event? event)Check if event is task based, alias ::unregister-and-dispatch-original
Check if event is task based, alias `::unregister-and-dispatch-original`
(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)Updates original event of maybe task event, returns maybe modified event.
Updates original event of maybe task `event`, returns maybe modified `event`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |