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

Can this be used with async await #3

Open
AWR14 opened this issue May 29, 2019 · 0 comments
Open

Can this be used with async await #3

AWR14 opened this issue May 29, 2019 · 0 comments

Comments

@AWR14
Copy link

AWR14 commented May 29, 2019

I want to add debounce to axios calls, currently have this.

can i replace axios here with faxios and keep async await or do i need to use promise? can you provide and example?

fetch = async () => {
    try {
      const response = await axios.post(this.props.apiUrl, {
        limit: this.state.limit,
        skip: this.state.skip,
      });

      this.setState({
        data: response.data.items
      });
    } catch (error) {
      message.error(`${error}`);
    }
  };
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