I'm having trouble figuring out how to work with a generic function using TypeScript's new ts-check feature.
/**
* @type {Reducer<IPoiState, any>}
*/
const poi = handleActions({
[ADD_BOOKMARK_START]: (state) => {
return { ...state };
},
}, {});
The handleActions type is from Definitey Typed and has the following structure...
export function handleActions<State>(
reducerMap: ReducerMap<State>,
initialState: State
): Reducer<State, any>;
However, I am encountering an error that states...
Type 'Reducer<{}, any>' is not assignable to type 'Reducer<IPoiState, any>'.
Type '{}' is not assignable to type 'IPoiState'.
Is there a way to bypass this generic constraint?