Skip to content

Instantly share code, notes, and snippets.

@ilyalesik
Last active July 18, 2018 09:28
Show Gist options
  • Select an option

  • Save ilyalesik/b3598dae96aa7a1fef25f7e48e13713b to your computer and use it in GitHub Desktop.

Select an option

Save ilyalesik/b3598dae96aa7a1fef25f7e48e13713b to your computer and use it in GitHub Desktop.
import { todoRequest } from "./api"
function* todoRequestWorker() {
try {
const result = yield call(todoRequest);
yield put({type: "FETCH_TODO_SUCCESS", value: result});
return result;
} catch (e) {
yield put({type: "FETCH_TODO_ERROR", e});
}
}
function* fetchTodoWorker() {
const result = yield call(todoRequestWorker);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment