Skip to content

@asyncAction with ES6 (not TypeScript) #70

Closed
@d4rky-pl

Description

@d4rky-pl

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions