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

@asyncAction with ES6 (not TypeScript) #70

Closed
d4rky-pl opened this issue Aug 4, 2017 · 3 comments
Closed

@asyncAction with ES6 (not TypeScript) #70

d4rky-pl opened this issue Aug 4, 2017 · 3 comments

Comments

@d4rky-pl
Copy link
Contributor

d4rky-pl commented Aug 4, 2017

It seems that generator functions do not work with decorators.

I've tried using @asynAction something = function*() {} but it does not seem to work properly.

The easiest workaround so far seems to be:

class Foo {
  fetch = asyncAction(function* fetch() {
    // ... code ...
  })
}

It might be a good idea to add this to README :) I can send a PR if you agree.

@mweststrate
Copy link
Member

@d4rky-pl agreed :)

@jshaker
Copy link

jshaker commented Sep 3, 2017

Why not just call a regular action within an async function?

@d4rky-pl
Copy link
Contributor Author

d4rky-pl commented Sep 4, 2017

@mweststrate This will take a bit longer, I'm afraid. The comments in code are not always valid JSDOC so every time documentation is regenerated, there are some things missing, some broken etc. I will dig into it when I have more spare time :)

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

3 participants