⚡️ The fastest key/value storage for React Native. ~30x faster than AsyncStorage!
OTHER License
Bot releases are hidden (Show)
Published by mrousavy over 1 year ago
Published by mrousavy over 1 year ago
fastWrites
prop2.7.0 adds a new prop to the MMKV configuration that changes the behaviour of set
calls.
fastWrites
is set to true
, MMKV does not overwrite previous values when calling set
. This is faster, but uses more memory.fastWrites
is set to false
, MMKV deletes the previous value before calling set
. This makes sure the storage size is always as small as possible, with the added performance cost of one delete call before setting.Before this version, MMKV behaved as if fastWrites
was set to true
(i.e.; fast, but use more memory). Now after this PR, fastWrites
is false
by default, because users were complaining in #440 that the storage size grows too big.
Published by mrousavy almost 2 years ago
Starting from 2.6.0., react-native-mmkv only works on react-native 0.71 and above.
If you use react-native 0.70 and below, you should use react-native-mmkv 2.5.1.
Published by mrousavy almost 2 years ago
Starting from 2.6.0., react-native-mmkv only works on react-native 0.71 and above.
If you use react-native 0.70 and below, you should use react-native-mmkv 2.5.1.
Published by mrousavy almost 2 years ago
Published by mrousavy almost 2 years ago
Example:
const storage = new MMKV()
// Set to storage
const buffer = new Uint8Array([255, 100, 8, 5])
storage.set('someToken', buffer)
// Get from storage
const buffer = storage.getBuffer('someToken')
console.log(buffer) // [255, 100, 8, 5]
// Fun Fact:
// You can read every value as a Buffer:
storage.set('someString', 'Hey!');
const buffer = storage.getBuffer('someString')
console.log(buffer); // [72, 101, 121, 33]
Published by mrousavy almost 2 years ago
Published by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
This release now makes MMKV's API even simpler and more consistent 🎉
getNumber(...)
now returns undefined
instead of 0
as a default value, virtually without any added runtime costgetBoolean(...)
now returns undefined
instead of false
as a default value, virtually without any added runtime costPublished by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
Published by mrousavy over 2 years ago
RCTUnsafeExecuteOnMainQueueSync
instead of dispatch_sync
- unsafe is my middle name ;) (41f0471)Published by mrousavy over 2 years ago
encrypt
-> recrypt
(6fcbd04)storage.recrypt(..)
) (#314) (aabc43b)useMMKVListener
hook (#317) (db31f18)toString()
and toJSON()
) (#316) (fefca24)