UNPKG

react-native-mmkv

Version:

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

13 lines (12 loc) 421 B
import { createMMKVHook } from './createMMKVHook'; /** * Use the boolean value of the given `key` from the given MMKV storage instance. * * If no instance is provided, a shared default instance will be used. * * @example * ```ts * const [isPremiumAccount, setIsPremiumAccount] = useMMKVBoolean("user.isPremium") * ``` */ export const useMMKVBoolean = createMMKVHook((instance, key) => instance.getBoolean(key));