Async coeffects (acofx) for re-frame: input an event needs from the outside world that only arrives asynchronously -- a backend request, an IPC call, an async browser API.
Register a handler with reg-acofx, or reuse an existing effect with
reg-acofx-by-fx, and inject it into an event with inject-acofx
or inject-acofxs. The event handler then runs once, with every acofx
value in its coeffects, instead of a chain of load, success and
further events.
Async coeffects (acofx) for re-frame: input an event needs from the outside world that only arrives asynchronously -- a backend request, an IPC call, an async browser API. Register a handler with [[reg-acofx]], or reuse an existing effect with [[reg-acofx-by-fx]], and inject it into an event with [[inject-acofx]] or [[inject-acofxs]]. The event handler then runs once, with every acofx value in its coeffects, instead of a chain of load, success and further events.
Keeps a re-frame-tasks task running while the acofxs of its event are underway.
An event with acofxs is aborted and dispatched again once they are
done, see jtk-dvlp.re-frame.async-coeffects/inject-acofxs.
Without this namespace the task of the aborted run ends with it, and
the run with the results opens a second one. Here the task is claimed
while the acofxs run and the event picks it up again when it comes
back.
Its own namespace, so re-frame-tasks is only needed by who requires it.
Keeps a re-frame-tasks task running while the acofxs of its event are underway. An event with acofxs is aborted and dispatched again once they are done, see [[jtk-dvlp.re-frame.async-coeffects/inject-acofxs]]. Without this namespace the task of the aborted run ends with it, and the run with the results opens a second one. Here the task is claimed while the acofxs run and the event picks it up again when it comes back. Its own namespace, so re-frame-tasks is only needed by who requires it.
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 |