@jsenv/navi 0.29.127 → 0.29.129
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/jsenv_navi.js +144 -82
- package/dist/jsenv_navi.js.map +8 -6
- package/docs/actions.md +3 -2
- package/docs/offline.md +7 -5
- package/package.json +1 -1
package/docs/actions.md
CHANGED
|
@@ -13,8 +13,9 @@ const getUser = createAction(async ({ id }, { signal }) => {
|
|
|
13
13
|
});
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
The callback receives `(params, { reason, event, signal, isPrerun })`.
|
|
17
|
-
is aborted when the run is called off — pass it to `fetch`.
|
|
16
|
+
The callback receives `(params, { reason, event, signal, isPrerun, action })`.
|
|
17
|
+
`signal` is aborted when the run is called off — pass it to `fetch`. `action` is
|
|
18
|
+
the instance being run.
|
|
18
19
|
|
|
19
20
|
`resource()` creates one action per REST callback rather than having you write
|
|
20
21
|
them by hand — see [resource.md](./resource.md).
|
package/docs/offline.md
CHANGED
|
@@ -51,9 +51,11 @@ it once, at startup; there is nothing else to wire.
|
|
|
51
51
|
Under a truthy reason, no resource callback is called. What happens instead
|
|
52
52
|
depends on what was asked:
|
|
53
53
|
|
|
54
|
-
- **A `GET` answers from the store.** If the row
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
- **A `GET` answers from the store.** If the row it designates is there, the
|
|
55
|
+
action completes with it and nothing is asked. The row is the one its params
|
|
56
|
+
name — by the resource's `idKey`, or by any of its `uniqueKeys` — or, when
|
|
57
|
+
the params name none (a `GET` without params, like `/me`), the row the
|
|
58
|
+
action last completed with. Going from game A to game B, both read
|
|
57
59
|
before, is a change of params that would normally rerun `GAME.GET`; under the
|
|
58
60
|
policy it completes from the store, and a screen that does not take
|
|
59
61
|
`error: true` keeps drawing what it holds instead of falling into its error
|
|
@@ -64,8 +66,8 @@ depends on what was asked:
|
|
|
64
66
|
action's own value knows which ids answered `/users?scope=shareable`. So a
|
|
65
67
|
rerun asked of a completed read under the policy is held — the action keeps
|
|
66
68
|
its state, its value and its data, exactly as a `run()` on a completed action
|
|
67
|
-
would. This is the piece an app cannot do on its own: the
|
|
68
|
-
its action.
|
|
69
|
+
would. This is the piece an app cannot do on its own: by the time a callback
|
|
70
|
+
runs, its action has already been reset.
|
|
69
71
|
- **A `GET_RANGE` revalidation fails quietly.** A list that comes back to the
|
|
70
72
|
screen draws the composition it left and asks again for the window it draws;
|
|
71
73
|
under the policy that ask fails, and a failed revalidation keeps the rows it
|