UNPKG

react-native-mmkv

Version:

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

16 lines (14 loc) 433 B
import { createMMKVHook } from './createMMKVHook' /** * Use the buffer value (unsigned 8-bit (0-255)) 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 [privateKey, setPrivateKey] = useMMKVBuffer("user.privateKey") * ``` */ export const useMMKVBuffer = createMMKVHook((instance, key) => instance.getBuffer(key) )