- commit
- e12acac
- parent
- 09eba9f
- author
- Eric Bower
- date
- 2023-12-12 02:49:16 +0000 UTC
docs: readme
1 files changed,
+8,
-7
+8,
-7
1@@ -242,11 +242,8 @@ function* supervisor() {
2 }
3 ```
4
5-Here we call some task that should always be in a running and in a healthy
6-state. If it raises an exception, we log it and try to run the task again.
7-
8-All thunks and endpoints do is listen for particular actions being emitted onto
9-the `ActionContext`, which is just an event emitter.
10+Here we call some task that should always be in a running and healthy state. If
11+it raises an exception, we log it and try to run the task again.
12
13 ```ts
14 import { parallel, run, takeEvery } from "starfx";
15@@ -288,9 +285,13 @@ function* watchFetch() {
16
17 That's better, now only one task can be alive at one time.
18
19+Both thunks and endpoints simply listen for particular actions being emitted
20+onto the `ActionContext` -- which is just an event emitter -- and then call the
21+middleware stack with that action.
22+
23 Both thunks and endpoints support overriding the default `takeEvery` supervisor
24-for either our officially supported supervisors `takeLatest` and `takeLeading`
25-or even a custom one!
26+for either our officially supported supervisors `takeLatest` and `takeLeading`,
27+or a user-defined supervisor.
28
29 That's it. We are just leveraging the same tiny API that we are already using in
30 `starfx`.