Commit 8907715
committed
Determine type of sidebar store automatically
Avoid the need to manually create the `SidebarStore` type by inferring
it automatically. This works as follows:
1. The `modules` argument to `createStore` has been converted to a
tuple type (`[ModuleA, ModuleB, ...]`)
2. The type of a module that would result from merging all the
individual modules (`ModuleA & ModuleB ...`) is computed
using a `TupleToIntersection` utility type
3. `StoreFromModule` is used to compute the type of the store that the
merged module would produce1 parent 9d40fff commit 8907715
2 files changed
Lines changed: 23 additions & 33 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
86 | 101 | | |
87 | 102 | | |
88 | 103 | | |
| |||
107 | 122 | | |
108 | 123 | | |
109 | 124 | | |
110 | | - | |
| 125 | + | |
| 126 | + | |
111 | 127 | | |
112 | 128 | | |
113 | | - | |
| 129 | + | |
114 | 130 | | |
115 | 131 | | |
116 | 132 | | |
| |||
174 | 190 | | |
175 | 191 | | |
176 | 192 | | |
177 | | - | |
| 193 | + | |
178 | 194 | | |
179 | 195 | | |
180 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
| 20 | + | |
44 | 21 | | |
45 | 22 | | |
46 | 23 | | |
| |||
52 | 29 | | |
53 | 30 | | |
54 | 31 | | |
55 | | - | |
56 | 32 | | |
57 | 33 | | |
58 | 34 | | |
59 | 35 | | |
60 | 36 | | |
61 | | - | |
| 37 | + | |
62 | 38 | | |
63 | 39 | | |
64 | 40 | | |
| |||
75 | 51 | | |
76 | 52 | | |
77 | 53 | | |
78 | | - | |
79 | | - | |
80 | | - | |
81 | | - | |
| 54 | + | |
| 55 | + | |
82 | 56 | | |
0 commit comments