Skip to content
New issue

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

feat: add poll effect type #2158

Merged
merged 1 commit into from
Jul 12, 2019
Merged

feat: add poll effect type #2158

merged 1 commit into from
Jul 12, 2019

Conversation

zhanba
Copy link
Contributor

@zhanba zhanba commented Jul 11, 2019

Checklist
  • npm test passes
  • tests are included
  • documentation is changed or added
  • commit message follows commit guidelines
Description of change
  • 添加新的effect 类型 poll,用来处理轮询逻辑
  • add new effect type poll
effects: {
    pollAdd: [
       function*(_, { put }) {
           yield put({ type: 'add', payload: 1 });
       },
       { type: 'poll', delay: 1000 },
    ],
},

// start polling
dispatch({ type: 'count/pollAdd-start' });

// stop polling
dispatch({ type: 'count/pollAdd-stop' })

@coveralls
Copy link

Coverage Status

Coverage increased (+0.4%) to 87.681% when pulling f88198b on zhanba:feat/add-poll-effect into 2b9f315 on dvajs:master.

@sorrycc sorrycc merged commit a5bdcd0 into dvajs:master Jul 12, 2019
GoToBoy pushed a commit to GoToBoy/dva that referenced this pull request Oct 12, 2023
GoToBoy pushed a commit to GoToBoy/dva that referenced this pull request Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants