Skip to content

Instantly share code, notes, and snippets.

@KamMif
Created September 9, 2018 17:42
Show Gist options
  • Save KamMif/8d011b9bf6a200042d740ab23792039d to your computer and use it in GitHub Desktop.
Save KamMif/8d011b9bf6a200042d740ab23792039d to your computer and use it in GitHub Desktop.
function* RequestData() {
try {
yield put(requestData());
while (true) {
yield call(delay, 60000);
const data = yield call(fetchDataStatus);
if (data.res) {
yield put(requestDataSuccess(data.resp));
}
}
}
catch (e) {
console.log('Error: ', e);
yield put(requestDataFailed(e.message));
console.log('Data dashboard error:', e)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment