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

How to prevent API call on page load? #11

Open
gopinav opened this issue Apr 15, 2023 · 1 comment
Open

How to prevent API call on page load? #11

gopinav opened this issue Apr 15, 2023 · 1 comment

Comments

@gopinav
Copy link

gopinav commented Apr 15, 2023

Currently useTextBuffer makes the API call on page load and I can't seem to prevent that behaviour with an option. I would like to make the API call on a button click only when the prompt has been entered by the user. Is something like enabled: false option possible? An idea from react-query's useQuery option.

@vdaita
Copy link

vdaita commented Jul 26, 2023

In the backend, you could use an if-statement on the client-provided data to decide whether to make the API call or not.

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