Liking cljdoc? Tell your friends :D

jtk-dvlp.re-frame.tasks


add-completion-keys-for-effect!cljs

(add-completion-keys-for-effect! effect-key & completion-keys)

Adds completion keys for effect.

Adds completion keys for effect.
sourceraw docstring

as-taskcljs

(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.
sourceraw docstring

assoc-orignal-eventcljs

(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`.
sourceraw docstring

attach-after-eventcljs

(attach-after-event db id-or-task event)

Attaches events called after task completion.

Attaches events called after task completion.
sourceraw docstring

ensure-original-eventcljs

(ensure-original-event event original-event)

Ensures original-event for direct use or with task.

Ensures `original-event` for direct use or with task.
sourceraw docstring

get-original-eventcljs

(get-original-event event)

Get original event of task event or event itself.

Get original event of task event or `event` itself.
sourceraw docstring

get-taskcljs

(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.
sourceraw docstring

get-task-by-namecljs

(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.
sourceraw docstring

get-taskscljs

(get-tasks db)

Gets all tasks in app-db. Can return nil

Gets all tasks in app-db. Can return nil
sourceraw docstring

merge-completion-keys-per-effect!cljs

Merge completion keys per effect via map {:effect #{:completion-keys,,,}}.

Merge completion keys per effect via map `{:effect #{:completion-keys,,,}}`.
sourceraw docstring

registercljs

(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?`.
sourceraw docstring

running?cljs

(running? db name)

Checks for running task in app-db via name.

Checks for running task in app-db via `name`.
sourceraw docstring

set-completion-keys-per-effect!cljs

Sets completion keys per effect via map {:effect #{:completion-keys,,,}}.

Sets completion keys per effect via map `{:effect #{:completion-keys,,,}}`.
sourceraw docstring

some-original-event?cljs

(some-original-event? event)

Checks for some original event of task or event itself.

Checks for some original event of task or `event` itself.
sourceraw docstring

task-event?cljs

(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`
sourceraw docstring

unregistercljs

(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?`.
sourceraw docstring

update-original-eventcljs

(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`.
sourceraw docstring

while-taskcljs

(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.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close