Skip to content

Add method to check if MMKV instance with given ID exists #700

Open
@DorianMazur

Description

@DorianMazur

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:

import { MMKV } from 'react-native-mmkv'

const instanceExists = MMKV.exists('some-id')
console.log(instanceExists) // Should return true or false

Benefits:

  • Simplifies instance management in apps using multiple MMKV stores
  • Helps prevent accidental overwriting of existing instances

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions