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

[RFC]Support async generator as Effect #59

Open
Brooooooklyn opened this issue Nov 12, 2019 · 0 comments
Open

[RFC]Support async generator as Effect #59

Brooooooklyn opened this issue Nov 12, 2019 · 0 comments

Comments

@Brooooooklyn
Copy link
Contributor

RxJS is great as process management, but sometimes our Effect dosen't need too much async management ability. So I really want a simpler way to provide async management ability.

@GeneratorEffect()
async fetchUserInfo(payload:  T) {
  const response = await client.query({ ... })
  try {
    yield this.getActions().setUserInfo(assertSuccess(response))
  } catch (e) {
    yield this.getActions().getUserInfoFailed(e)
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant