Skip to content

Commit

Permalink
Improve typing of StateReducer
Browse files Browse the repository at this point in the history
Co-Authored-By: Marco Ciampini <[email protected]>
  • Loading branch information
stokesman and ciampo committed Jul 28, 2022
1 parent 502ad98 commit 30d7c31
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/components/src/input-control/reducer/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ export interface InputState {
value?: string;
}

export type StateReducer< SpecializedAction = Action > = Reducer<
export type StateReducer< SpecializedAction = {} > = Reducer<
InputState,
InputAction | SpecializedAction
SpecializedAction extends Action
? InputAction | SpecializedAction
: InputAction
>;

export const initialStateReducer: StateReducer = ( state: InputState ) => state;
Expand Down

0 comments on commit 30d7c31

Please sign in to comment.