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

[Bug] Actions force you to be async #67

Open
robertofd1995 opened this issue Apr 20, 2020 · 2 comments
Open

[Bug] Actions force you to be async #67

robertofd1995 opened this issue Apr 20, 2020 · 2 comments

Comments

@robertofd1995
Copy link

I am creating a new project with Nuxt and I have added your library (thanks for your work by the way ;) ) but there is a problem with the Action decorator.

It force me all the time to return promises even if I don't want to.

For example in this piece of code:

  @action test() {
    console.log('IP UP UASD!')
    return 1
  }

I get the following error:

Captura de pantalla 2020-04-20 a las 9 44 38

So even If I don't put the async there and I ignore the error suppressing it with // @ts-ignore, when I use it in my component I get a promise, and again I am force to put async and await inside the method of the component without sense.

I guess this is fault of the types, but I try to take a look and see If I could create a pull request to fix it but I am not that proficient with Typescript and how the decorators work.

How can I make it work with as a non async action?

Thanks in advance.

@samuil4
Copy link

samuil4 commented Apr 30, 2020

I do have the same problem...

@nunonux
Copy link

nunonux commented May 6, 2020

Vuex actions always returns a promise, it's in the documentation, so I think it's because of that.

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