-
-
Notifications
You must be signed in to change notification settings - Fork 32
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
Feature request: hooks for data fetch #189
Comments
Oh, i didn't see |
Update: onFulfilled function in |
@logaretm Do you think we can do the same thing for mutations ? |
@jbaubree Usually mutations are executed explicitly, so I don't think it is as common as queries but I don't see the harm. Feel free to PR it, and I guess you ran into needing it recently, would love to hear about it as well, use-case wise. |
@logaretm There are several reasons why I think it is necessary.
Second reason, i find code more readable like this:
If you confirm that you are ok with that, i will PR it when i will get some free time |
Hi @logaretm,
First of all, this library is great job.
Clear and concise description of the problem
When we use fetching APIs like fetch, axios or villus, we need almost all the time to work with data, specially setting mapping response data.
Currently, the only solution i found to do that with villus is using watcher and i find this not optimize:
Suggested solution
Add hooks like onSuccess, onError like this is setup on Apollo
I think this is a small feature that will help a lot.
What do you think about it ?
The text was updated successfully, but these errors were encountered: