Skip to content
This repository was archived by the owner on Apr 8, 2020. It is now read-only.

Commit 29f51ec

Browse files
committed
Fix typings
1 parent 1412c9f commit 29f51ec

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/reducer.ts

+4-6
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,10 @@ export const appearStartedState = stateFunc(StateID.AppearStarted, "appear");
180180
export const enterStartedState = stateFunc(StateID.EnterStarted, "enter");
181181
export const leaveStartedState = stateFunc(StateID.LeaveStarted, "leave");
182182

183-
export type Reducer = typeof reducer;
183+
export type Reducer = (stateID: StateID, action: Action) =>
184+
{ state: TransitionState, pending?: ActionID, completed?: boolean };
184185

185-
export function reducer(
186-
stateID: StateID,
187-
action: Action,
188-
): { state: TransitionState, pending?: ActionID, completed?: boolean } {
186+
export const reducer: Reducer = (stateID, action) => {
189187
const props = action.props;
190188
switch (action.kind) {
191189
case ActionID.Init:
@@ -290,4 +288,4 @@ export function reducer(
290288
default:
291289
}
292290
throw new Error("unexpected error");
293-
}
291+
};

0 commit comments

Comments
 (0)