react-native-mmkv
Version:
⚡️ The fastest key/value storage for React Native.
16 lines (14 loc) • 387 B
text/typescript
import { createMMKVHook } from './createMMKVHook'
/**
* Use the number 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 [age, setAge] = useMMKVNumber("user.age")
* ```
*/
export const useMMKVNumber = createMMKVHook((instance, key) =>
instance.getNumber(key)
)