Skip to content

Commit 63e4926

Browse files
MikeRyanDevbrandonroberts
authored andcommitted
feat(store): expand createReducer type signature to support up to ten action creators (#1803)
1 parent ecda5f7 commit 63e4926

File tree

1 file changed

+133
-0
lines changed

1 file changed

+133
-0
lines changed

modules/store/src/reducer_creator.ts

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,139 @@ export function on<
3232
creator3: C3,
3333
reducer: OnReducer<S, [C1, C2, C3]>
3434
): On<S>;
35+
export function on<
36+
C1 extends ActionCreator,
37+
C2 extends ActionCreator,
38+
C3 extends ActionCreator,
39+
C4 extends ActionCreator,
40+
S
41+
>(
42+
creator1: C1,
43+
creator2: C2,
44+
creator3: C3,
45+
creator4: C4,
46+
reducer: OnReducer<S, [C1, C2, C3, C4]>
47+
): On<S>;
48+
export function on<
49+
C1 extends ActionCreator,
50+
C2 extends ActionCreator,
51+
C3 extends ActionCreator,
52+
C4 extends ActionCreator,
53+
C5 extends ActionCreator,
54+
S
55+
>(
56+
creator1: C1,
57+
creator2: C2,
58+
creator3: C3,
59+
creator4: C4,
60+
creator5: C5,
61+
reducer: OnReducer<S, [C1, C2, C3, C4, C5]>
62+
): On<S>;
63+
export function on<
64+
C1 extends ActionCreator,
65+
C2 extends ActionCreator,
66+
C3 extends ActionCreator,
67+
C4 extends ActionCreator,
68+
C5 extends ActionCreator,
69+
C6 extends ActionCreator,
70+
S
71+
>(
72+
creator1: C1,
73+
creator2: C2,
74+
creator3: C3,
75+
creator4: C4,
76+
creator5: C5,
77+
creator6: C6,
78+
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6]>
79+
): On<S>;
80+
export function on<
81+
C1 extends ActionCreator,
82+
C2 extends ActionCreator,
83+
C3 extends ActionCreator,
84+
C4 extends ActionCreator,
85+
C5 extends ActionCreator,
86+
C6 extends ActionCreator,
87+
C7 extends ActionCreator,
88+
S
89+
>(
90+
creator1: C1,
91+
creator2: C2,
92+
creator3: C3,
93+
creator4: C4,
94+
creator5: C5,
95+
creator6: C6,
96+
creator7: C7,
97+
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6, C7]>
98+
): On<S>;
99+
export function on<
100+
C1 extends ActionCreator,
101+
C2 extends ActionCreator,
102+
C3 extends ActionCreator,
103+
C4 extends ActionCreator,
104+
C5 extends ActionCreator,
105+
C6 extends ActionCreator,
106+
C7 extends ActionCreator,
107+
C8 extends ActionCreator,
108+
S
109+
>(
110+
creator1: C1,
111+
creator2: C2,
112+
creator3: C3,
113+
creator4: C4,
114+
creator5: C5,
115+
creator6: C6,
116+
creator7: C7,
117+
creator8: C8,
118+
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6, C7, C8]>
119+
): On<S>;
120+
export function on<
121+
C1 extends ActionCreator,
122+
C2 extends ActionCreator,
123+
C3 extends ActionCreator,
124+
C4 extends ActionCreator,
125+
C5 extends ActionCreator,
126+
C6 extends ActionCreator,
127+
C7 extends ActionCreator,
128+
C8 extends ActionCreator,
129+
C9 extends ActionCreator,
130+
S
131+
>(
132+
creator1: C1,
133+
creator2: C2,
134+
creator3: C3,
135+
creator4: C4,
136+
creator5: C5,
137+
creator6: C6,
138+
creator7: C7,
139+
creator8: C8,
140+
creator9: C9,
141+
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6, C7, C8, C9]>
142+
): On<S>;
143+
export function on<
144+
C1 extends ActionCreator,
145+
C2 extends ActionCreator,
146+
C3 extends ActionCreator,
147+
C4 extends ActionCreator,
148+
C5 extends ActionCreator,
149+
C6 extends ActionCreator,
150+
C7 extends ActionCreator,
151+
C8 extends ActionCreator,
152+
C9 extends ActionCreator,
153+
C10 extends ActionCreator,
154+
S
155+
>(
156+
creator1: C1,
157+
creator2: C2,
158+
creator3: C3,
159+
creator4: C4,
160+
creator5: C5,
161+
creator6: C6,
162+
creator7: C7,
163+
creator8: C8,
164+
creator9: C9,
165+
creator10: C10,
166+
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10]>
167+
): On<S>;
35168
export function on<S>(
36169
creator: ActionCreator,
37170
...rest: (ActionCreator | OnReducer<S, [ActionCreator]>)[]

0 commit comments

Comments
 (0)