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

Allow resetting the solutions object, or setting it to undefined for any subsequent call. #139

Open
Tbaut opened this issue Jan 23, 2025 · 1 comment

Comments

@Tbaut
Copy link
Collaborator

Tbaut commented Jan 23, 2025

When using the react sdk and our hooks, I figured that the fact that we have no promise for the getPoolAssetOnDestination for instance, and rather wait for solutions to not be undefined makes it so that if the user changes their input (and hence it changes the params for the api calls) then the solutions will be outdated for the time until the api responds.

Ideally, we should have a reset param that we could call, and that would set the solutions to undefined.
Or we should make sure the solutions is undefined before we do a call to the api, just like we set the loading to true.

What do you think?

@saadahmsiddiqui
Copy link
Member

IMO rather than storing solution state within the SDK it'd be better to "promisify" it and let devs handle it themselves?

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