dvajs / dva

🌱 React and redux based, lightweight and elm-style framework. (Inspired by elm and choo)
https://dvajs.com/
MIT License
16.25k stars 3.16k forks source link

怎么取消终止一个 effects #2406

Closed yangjiaqiao closed 3 years ago

yangjiaqiao commented 3 years ago

我在执行后,需要重新执行effects ,这么去实现呢 *check({ payload }, { put, call, select }) { while (true) { yield call(delay, 1500); const qrCodeToken = yield select(state => state.auth.qrCodeToken); const data = yield call(checkQrCode, { token: qrCodeToken }); if (data.code === 200) { setToken(data.data.access_token); yield put({ type: 'authSuccess', payload: { token: data.data.access_token, }, }); history.push('/'); return false; } else if (data.code === 501) { return false; } } },

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.