Skip to content

Commit

Permalink
feat(store): Expand createReducer type signature to support up to ten…
Browse files Browse the repository at this point in the history
… action creators
  • Loading branch information
MikeRyanDev committed Apr 25, 2019
1 parent 46678f2 commit 87cd089
Showing 1 changed file with 133 additions and 0 deletions.
133 changes: 133 additions & 0 deletions modules/store/src/reducer_creator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,139 @@ export function on<
creator3: C3,
reducer: OnReducer<S, [C1, C2, C3]>
): On<S>;
export function on<
C1 extends ActionCreator,
C2 extends ActionCreator,
C3 extends ActionCreator,
C4 extends ActionCreator,
S
>(
creator1: C1,
creator2: C2,
creator3: C3,
creator4: C4,
reducer: OnReducer<S, [C1, C2, C3, C4]>
): On<S>;
export function on<
C1 extends ActionCreator,
C2 extends ActionCreator,
C3 extends ActionCreator,
C4 extends ActionCreator,
C5 extends ActionCreator,
S
>(
creator1: C1,
creator2: C2,
creator3: C3,
creator4: C4,
creator5: C5,
reducer: OnReducer<S, [C1, C2, C3, C4, C5]>
): On<S>;
export function on<
C1 extends ActionCreator,
C2 extends ActionCreator,
C3 extends ActionCreator,
C4 extends ActionCreator,
C5 extends ActionCreator,
C6 extends ActionCreator,
S
>(
creator1: C1,
creator2: C2,
creator3: C3,
creator4: C4,
creator5: C5,
creator6: C6,
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6]>
): On<S>;
export function on<
C1 extends ActionCreator,
C2 extends ActionCreator,
C3 extends ActionCreator,
C4 extends ActionCreator,
C5 extends ActionCreator,
C6 extends ActionCreator,
C7 extends ActionCreator,
S
>(
creator1: C1,
creator2: C2,
creator3: C3,
creator4: C4,
creator5: C5,
creator6: C6,
creator7: C7,
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6, C7]>
): On<S>;
export function on<
C1 extends ActionCreator,
C2 extends ActionCreator,
C3 extends ActionCreator,
C4 extends ActionCreator,
C5 extends ActionCreator,
C6 extends ActionCreator,
C7 extends ActionCreator,
C8 extends ActionCreator,
S
>(
creator1: C1,
creator2: C2,
creator3: C3,
creator4: C4,
creator5: C5,
creator6: C6,
creator7: C7,
creator8: C8,
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6, C7, C8]>
): On<S>;
export function on<
C1 extends ActionCreator,
C2 extends ActionCreator,
C3 extends ActionCreator,
C4 extends ActionCreator,
C5 extends ActionCreator,
C6 extends ActionCreator,
C7 extends ActionCreator,
C8 extends ActionCreator,
C9 extends ActionCreator,
S
>(
creator1: C1,
creator2: C2,
creator3: C3,
creator4: C4,
creator5: C5,
creator6: C6,
creator7: C7,
creator8: C8,
creator9: C9,
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6, C7, C8, C9]>
): On<S>;
export function on<
C1 extends ActionCreator,
C2 extends ActionCreator,
C3 extends ActionCreator,
C4 extends ActionCreator,
C5 extends ActionCreator,
C6 extends ActionCreator,
C7 extends ActionCreator,
C8 extends ActionCreator,
C9 extends ActionCreator,
C10 extends ActionCreator,
S
>(
creator1: C1,
creator2: C2,
creator3: C3,
creator4: C4,
creator5: C5,
creator6: C6,
creator7: C7,
creator8: C8,
creator9: C9,
creator10: C10,
reducer: OnReducer<S, [C1, C2, C3, C4, C5, C6, C7, C8, C9, C10]>
): On<S>;
export function on<S>(
creator: ActionCreator,
...rest: (ActionCreator | OnReducer<S, [ActionCreator]>)[]
Expand Down

0 comments on commit 87cd089

Please sign in to comment.