Comments (4)
I'm not sure I fully understand the issue you're reporting. Would you mind providing reproduction examples or steps and more details?
from swrv.
SomeComponent.vue has a prop called id and has the following code in it:
const { data, error, isValidating } = useSWRV(() => '/api?id=' + props.id)
Now, if you change the id prop value passed to SomeComponent.vue while a fetch is active, it will trigger another fetch request (as expected) the problem is the isValidating of that new request will become false when the previous fetch call completes when it should obviously wait for the new call to complete (as these are different keys).
If you look at #26 you'll notice they've added a check to see they are not updating the "IsValidating" of a previous call, but they haven't done so in the problematic line I was referring to: https://github.com/Kong/swrv/blob/master/src/use-swrv.ts#L280
from swrv.
Did you get a chance to look into it? @adamdehaven
from swrv.
I think this could be resolved by utilizing dependent caching to invalidate the cache when the prop value changes.
from swrv.
Related Issues (20)
- dedupe subsequent requests with same key if this request is pending?
- Possible `key` type mismatch HOT 11
- Possibly unnecessary check HOT 1
- Could not get current instance, check to make sure that `useSwrv` is declared in the top level of the setup function. HOT 3
- Is swrv changed setTimeout in somewhere to make `await setTimeout` work๏ผ HOT 2
- TypeError when using in an app with moduleResolution nodenext
- [Feature request] Allow use of useSWRV outside of setup() HOT 20
- Precedence of fetching conditions
- forceRevalidate should have option or default to override debounce HOT 2
- Exceed the quota exception HOT 4
- How can I set options after useSWRV is initialized HOT 1
- How to use swrv with the array function? HOT 1
- Disable swrv for certain endpoints HOT 5
- Middleware feature request HOT 1
- how to read the data asynchronously HOT 6
- isLoading field HOT 4
- How to revalidate on fetcher change (like on key change) HOT 8
- [Feature request] Allow throwing an error in key getter function HOT 2
- How to revalidate manually and trigger data update immediately? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from swrv.