typesafe-actions
typesafe-actions copied to clipboard
Update redux-saga usage docs
Redux-saga solved (https://github.com/microsoft/TypeScript/pull/30790) the long-opened issue (https://github.com/Microsoft/TypeScript/issues/2983) mentioned in docs https://github.com/piotrwitek/typesafe-actions#with-redux-saga-sagas , so I suppose they can be updated with better example
Hey @Kamahl19, thanks for the heads up.
Are you able to provide an updated example?
I'm also interested in this. Actually the example with saga in the README doesn't work :/
@pybuche what do you mean doesnt work
There is a typo in the code example, but I realized it only a few hours ago :)
function* addTodoSaga(action: ReturnType<typeof fetchTodosAsync.request>): Generator {
try { // missing this line
const response: Todo[] = yield call(todosApi.getAll, action.payload);
yield put(fetchTodosAsync.success(response));
} catch (err) {
yield put(fetchTodosAsync.failure(err));
}
}
@pybuche created a bug for it #184, up for grabs