-
-
Notifications
You must be signed in to change notification settings - Fork 263
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
Add method to check if MMKV instance with given ID exists #700
Comments
Guten Tag, Hans here. Note New features, bugfixes, updates and other improvements are all handled mostly by |
Well you can just load the const instance = new MMKV({ id: 'some-id' })
const instanceExists = instance.getAllKeys().length > 0
console.log(instanceExists) // Should return true or false |
Or maybe |
I have encrypted instance, I need to check if instance exists before encrypting it. Initializing without encryption key will erase all data. |
This is also a bit weird imo - that should throw an error instead of erasing all data.. |
Description:
Currently, there's no straightforward way to check if an MMKV instance with a specific ID already exists. This functionality would be useful for managing multiple MMKV instances and avoiding conflicts or unnecessary instance creation.
Feature request:
Add a static method to the MMKV class that allows checking for the existence of an instance with a given ID.
Proposed usage:
Benefits:
The text was updated successfully, but these errors were encountered: