1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Fix tsc errors

This commit is contained in:
Henry Heino 2024-12-10 22:55:58 -08:00
parent 6021955187
commit 4fd9e4537e

View File

@ -454,12 +454,14 @@ const createNoteAndResource = async (options: CreateNoteAndResourceOptions = nul
return { note, resource };
};
export const createReduxStore = (defaultState: AppState = defaultAppState) => {
export const createReduxStore = <StateType extends AppState> (
defaultState: StateType = defaultAppState as StateType,
) => {
const mockReducer = (state: AppState = defaultState, action: unknown) => {
return reducer(state, action);
};
return createStore(mockReducer);
return createStore(mockReducer) as Store<StateType>;
};
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Old code before rule was applied