-
Notifications
You must be signed in to change notification settings - Fork 94
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 refresh promise which depends on multiple variables #303
Comments
For a proposal on my current project, I ended up going with something like this:
Not sure if that's better, but definitely another approach that works. I agree though that it would be nice to get some documentation on this kind of use case, because I have to imagine it's fairly common. |
@Josh-Marston-1005 that's a pretty good approach 👍 I think useMemo should be the recommended way. |
@ghengeveld Awesome, thanks man. Really helps me validate my thinking there, and thanks for making such a useful library for handling this kind of flow 👍 |
@Josh-Marston-1005 @ghengeveld Thanks for your comments. Gert, I can send out a PR updating the .md files (maybe something called watching.md), does that seem fine to you? |
@ApoorvGuptaAi Yes that would be great. Let's add a chapter in the Guide about "Watching for changes". It should come after Async Actions and before Optimistic Updates (in |
Raising an issue since I dont see clear documentation on this.
** Use case:
Given the following data in a component
I need to run an async function
getAsyncData(arg1, arg2)
(which takes as arguments arg1=data1.id and arg2=data2.id) everytime data1 or data2 changes.What i have come up with:
Seems like there is a concept of promiseFn and watch values, which seems like they can do this in a more concise way, but couldnt find good documentation on what that would look like. (Another bug(#254) talks about how arrays cant be used in the watch value, so having a recommended solution would be good).
The text was updated successfully, but these errors were encountered: