- commit
- 3baf359
- parent
- 9775bca
- author
- Eric Bower
- date
- 2024-01-08 16:37:55 +0000 UTC
fix(loader): consistent state shape
1 files changed,
+6,
-6
+6,
-6
1@@ -144,31 +144,31 @@ export const createLoader = <
2 start: (e) => (s) => {
3 const table = selectors.selectTable(s);
4 const loader = table[e.id];
5- table[e.id] = {
6+ table[e.id] = defaultLoaderItem({
7 ...loader,
8 ...e,
9 status: "loading",
10 lastRun: ts(),
11- };
12+ });
13 },
14 success: (e) => (s) => {
15 const table = selectors.selectTable(s);
16 const loader = table[e.id];
17- table[e.id] = {
18+ table[e.id] = defaultLoaderItem({
19 ...loader,
20 ...e,
21 status: "success",
22 lastSuccess: ts(),
23- };
24+ });
25 },
26 error: (e) => (s) => {
27 const table = selectors.selectTable(s);
28 const loader = table[e.id];
29- table[e.id] = {
30+ table[e.id] = defaultLoaderItem({
31 ...loader,
32 ...e,
33 status: "error",
34- };
35+ });
36 },
37 reset: () => (s) => {
38 // deno-lint-ignore no-explicit-any