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

[bug] useStorage instances are not updated when deleting the key/value #3598

Closed
7 tasks done
MathieuRA opened this issue Nov 30, 2023 · 2 comments · Fixed by #3737
Closed
7 tasks done

[bug] useStorage instances are not updated when deleting the key/value #3598

MathieuRA opened this issue Nov 30, 2023 · 2 comments · Fixed by #3737

Comments

@MathieuRA
Copy link

Describe the bug

If multiple instances of useStorage point to the same key, when deleting the key/value, only the instance used for the deletion is updated, the other instances keep the previous value.

Reproduction

https://play.vueuse.org/#N4IgDghgxg1hDmBTAziAXAbVAOwgW0XRADcBXRAWgBNE8BLEAGhGQHtSAnKQtEU7MDHhMQNZFA50wAFzqtsRAGrkABABFadFQAoAFhAA2AMxV1sKgGIdE2KLoCUp5CogqaxRAdZgz8FaVkDOmkATxcDLwB3ZxD2FWlWFUjJaUQVAFVsOg8OZEMVZTSAGToAIw4ISRQVI1YOAtUAJhUAMhUAZhFOAyJdaWkwZDQAemH+QXgAOihWPGGyShp6YaDS4bMaAA9JvAArVABfRhx8HhAAAQXSZERh5H1rKhE2Tm4icaERMQkpWXkiADKD0QVAaiHSN38gWCdBQky6HB6vD6AyGow+Uxmc0u5Gut3ulRB5wAjAAGSbEyak9bYLY7fYgI4nAhEHGIPHDGbWZ7sLhnDFfFA-GRyBS8ADCrAiiCgf3MrBMKBu2Fk+UKKkleDArGQMPkGWhshQCKRIBRgxGYwEQmms2GbI5XMQJPJlOpG0Q2z2hwAuswjHQDMa0KAAIJgMCTBboUCpLUGCCpIgAHio2QAfAADWqsTMqYiGchoFTAYA1ViJA4HZPDNPEdMAHWwqYzmdKlTzBYMRZLZfb9RUVZrdcbzdKAQS5nOUCCsAAvA2+GAqInEIuVMhQkGFyBSnUaBw0MSwJsN1K6KDSgnYABuFSQKhp7DwNAAVhPi-T4tnMHiiVIy6rvmhYoDW479PIo7JuBk4qNOP47tYeCsB466biE26LnuHAHkeJ5nkEoKPHeD5Pi+76bJ+350LAf4qEhKFpJudQIGkXbkGBE6Qc8wrSEQdBanU0glv4NwAgkFRIIONQcLMKgAOQOjcnJ1Ig8lNk2MzYJu5aJHOomIOJLFINo8kwIgITyYwKjYKQET2Jp8g6f2Kj6XiRmSYgpnmZZ1m2fZGnYEY-CyqK-iAak2iOMATYqCo-ZRiBrkKQkCTqdgByBcFthyvRtCMVFJaxfFlSJd2aT6f5BhNgcjJVkAA

System Info

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1185G7 @ 3.00GHz
    Memory: 9.41 GB / 15.33 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 20.9.0 - ~/.nvm/versions/node/v20.9.0/bin/node
    Yarn: 1.22.10 - /usr/local/bin/yarn
    npm: 10.1.0 - ~/.nvm/versions/node/v20.9.0/bin/npm
  Browsers:
    Brave Browser: 119.1.60.118
    Chrome: 119.0.6045.159
  npmPackages:
    vue: ^3.3.4 => 3.3.8

Used Package Manager

yarn

Validations

@DaedalusHatak
Copy link

By setting it back to null it's being deleted therefore not updated. If you really need to have 2 different variables for the same element maybe consider switching it to empty string or make it async with nextTick to reset it after

Copy link

stale bot commented Jan 30, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 30, 2024
@stale stale bot closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants