(add-completion-keys-for-effect! effect-key & completion-keys)Adds completion keys for effect.
Adds completion keys for effect.
(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`.
(attach-after-event db id-or-task event)Attaches events called after task completion.
Attaches events called after task completion.
(ensure-original-event event original-event)Ensures original-event for direct use or with task.
Ensures `original-event` for direct use or with task.
(get-original-event event)Get original event of task event or event itself.
Get original event of task event or `event` itself.
(get-task db id-or-task)Gets task in app-db via id-or-task. Can return nil.
Gets task in app-db via `id-or-task`. Can return nil.
(get-task-by-name db name)Gets task in app-db via name. Can return nil.
Gets task in app-db via `name`. Can return nil.
(get-tasks db)Gets all tasks in app-db. Can return nil
Gets all tasks in app-db. Can return nil
Merge completion keys per effect via map {:effect #{:completion-keys,,,}}.
Merge completion keys per effect via map `{:effect #{:completion-keys,,,}}`.
(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?`.
(running? db name)Checks for running task in app-db via name.
Checks for running task in app-db via `name`.
Sets completion keys per effect via map {:effect #{:completion-keys,,,}}.
Sets completion keys per effect via map `{:effect #{:completion-keys,,,}}`.
(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`.
(while-task action)(while-task action tasks)Creates an interceptor to control event execution during running tasks.
Choose via action between :cancel to cancel the event, :delay to delay
execution till task completion (last event call will take place, precendent
calls will be ignored) or :queue to queue executions till task completion
(considers call order).
Applicates for every task or selected tasks via their names.
Can be injected multiple times, consider injection order. Can be used as global interceptor, consider there is no reversal allow / pass functionality.
Creates an interceptor to control event execution during running tasks. Choose via `action` between `:cancel` to cancel the event, `:delay` to delay execution till task completion (last event call will take place, precendent calls will be ignored) or `:queue` to queue executions till task completion (considers call order). Applicates for every task or selected `tasks` via their names. Can be injected multiple times, consider injection order. Can be used as global interceptor, consider there is no reversal allow / pass functionality.
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 |