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

Optimistic local mutations with arrays #157

Open
inzanez opened this issue Apr 15, 2021 · 4 comments
Open

Optimistic local mutations with arrays #157

inzanez opened this issue Apr 15, 2021 · 4 comments

Comments

@inzanez
Copy link

inzanez commented Apr 15, 2021

Hi

I'm trying to use mutate with Vue3 next version to mutate the cache for a value that stores an array. As nothing worked so far, I had a look at data.value using console.log, and it seems that this is not stored as an array internally. I get some weird Proxy object with the array indices as properties.

Is there a way to actually use mutate for array values?

@darrenjennings
Copy link
Contributor

I get some weird Proxy object with the array indices as properties

data is a Vue Ref

data: Ref<Data | undefined>

@inzanez
Copy link
Author

inzanez commented Apr 15, 2021

@darrenjennings yeah, I found out that much, but still had no luck mutating it :-)

@darrenjennings
Copy link
Contributor

@inzanez do you have a codesandbox to repro? Here it is working as I expect (with vue composition api). Let me know if you think it is v3 specific.

https://codesandbox.io/s/swrv-157-79ek4

@inzanez
Copy link
Author

inzanez commented Apr 19, 2021

@darrenjennings I just tried to reproduce it in a codesandbox, but I didn't manage. So I guess it might have something to do with the combination of quasar framework and vue3 or the specific setup that I'm using. I will try to figure it out, but in the meantime I can live well with awaiting 'revalidate' after a change.

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