I am in the process of converting some code to TypeScript which currently looks like this:
const saga = function* (action) {
yield put({
type: actions.SUCCESS,
payload: action.payload
});
};
const sagaWatcher = createDefaultSagaWatcher(actions, saga);
To add type checking on the createDefaultSagaWatcher
function, I need to create an interface for the generator function. How can I achieve this?
I attempted creating an interface like this:
interface ReduxSaga {
(action: ReduxAction)* : any;
}
However, the syntax used in the interface is incorrect.