UNPKG

react-native-mmkv

Version:

⚡️ The fastest key/value storage for React Native.

16 lines (15 loc) 590 B
import type { MMKV } from '../specs/MMKV.nitro'; /** * Listen for changes in the given MMKV storage instance. * If no instance is passed, the default instance will be used. * @param valueChangedListener The function to call whenever a value inside the storage instance changes * @param instance The instance to listen to changes to (or the default instance) * * @example * ```ts * useMMKVListener((key) => { * console.log(`Value for "${key}" changed!`) * }) * ``` */ export declare function useMMKVListener(valueChangedListener: (key: string) => void, instance?: MMKV): void;