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

Callback when rest call completes #91

Closed
liftyourgame opened this issue Oct 27, 2018 · 2 comments
Closed

Callback when rest call completes #91

liftyourgame opened this issue Oct 27, 2018 · 2 comments

Comments

@liftyourgame
Copy link

How would you specify a callback so you can have code execute once the REST call completes?

@christianmalek
Copy link
Owner

christianmalek commented Oct 27, 2018

Hello @liftyourgame,

You can do it with async-await (or promises) outside of the initialization of the store. This is useful if you have to handle every call individually.

async foo() {
  try {
    await this.someAction();
    // success
  } catch (error) {
    // error
  }
}

Otherwise you can use onSuccess and onError.

@christianmalek
Copy link
Owner

I'll close this due to inactivity. Feel free to open a new issue.

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

2 participants