I implemented effectively the same thing in my Vue app as documented here. But the new data was not showing up in my table. I finally discovered that Vue does not update the UI if the object assigned to a ref's value is the same object as was there already. Everything was actually working correctly, but since the cached array was the same object as the original (although appended to), the UI was not updating.
So instead of writing this:
items.value = (await axios.get(url)).data
I changed it to this:
items.value = [...(await axios.get(url)).data]
and it works correctly.
I assume that this behavior is expected, so can we make a note of it in the documentation?
What happened?
I implemented effectively the same thing in my Vue app as documented here. But the new data was not showing up in my table. I finally discovered that Vue does not update the UI if the object assigned to a ref's value is the same object as was there already. Everything was actually working correctly, but since the cached array was the same object as the original (although appended to), the UI was not updating.
So instead of writing this:
I changed it to this:
and it works correctly.
I assume that this behavior is expected, so can we make a note of it in the documentation?
axios-cache-interceptor version
1.6.0
Node / Browser Version
N/A
Axios Version
1.7.7
What storage is being used
Memory Storage
Relevant debugging log output