We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
it('take', done => { const app = create(); app.model({ namespace: 'count', state: 0, reducers: { add(state, { payload }) { return state + payload || 1; }, }, effects: { *addDelay({ payload }, { put, call }) { yield call(delay, payload.delay || 100); yield put({ type: 'add', payload: payload.amount }); }, *test(action, { put, select, take }) { yield put({ type: 'addDelay', payload: { amount: 2 } }); ** yield take('addDelay/@@end'); ** const count = yield select(state => state.count); yield put({ type: 'addDelay', payload: { amount: count, delay: 0 } }); }, }, }); app.start(); app._store.dispatch({ type: 'count/test' }); setTimeout(() => { expect(app._store.getState().count).toEqual(4); done(); }, 300); });
上面是一段来自dva/packages/dva-core/test/effects.test.js的代码,里面的yield take('addDelay/@@end');是干嘛的?'addDelay/@@EnD'这种action pattern有什么特殊的含义吗? 我没看懂,请赐教。
dva/packages/dva-core/test/effects.test.js
yield take('addDelay/@@end');
npm test应该通过
npm test 提示错误Cannot find module 'redux' from 'index.js'
npm test
Cannot find module 'redux' from 'index.js'
on master branch commit id: b01c9a6
The text was updated successfully, but these errors were encountered:
@jibuji 看下dva2.0的发布日志:sorrycc/blog#48
Sorry, something went wrong.
@ishenli, I see, Thank you!
No branches or pull requests
Code to reproduce the issue: (请提供可复现的代码或者步骤)
上面是一段来自
dva/packages/dva-core/test/effects.test.js
的代码,里面的yield take('addDelay/@@end');
是干嘛的?'addDelay/@@EnD'这种action pattern有什么特殊的含义吗?我没看懂,请赐教。
Expected behavior: (预期的正常效果)
npm test应该通过
Actual behavior: (实际效果)
npm test
提示错误Cannot find module 'redux' from 'index.js'
Versions of packages used: (哪个库的哪个版本出现的问题)
on master branch commit id: b01c9a6
The text was updated successfully, but these errors were encountered: