Answer the question
In order to leave comments, you need to log in
How to type reducers?
Is there an easy way to type reducers that twitch not with actions, but with sagas? Now I type all actions with the help of this one. designs:
import * as actions from '../../actions';
type ActionsValueTypes<T> = T extends { [key: string]: infer K } ? K : never;
export type TratataActions = ReturnType<ActionsValueTypes<typeof actions>>
yield put({
type: REQUEST_TRATATA_SUCCESS,
data,
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question