-
Notifications
You must be signed in to change notification settings - Fork 65
Open
Description
Hello, need a bit of help i want to use another storage, i find react-native-mmkv good and fast, not sure if will improve performance but i want to give it a try, it seems to not work and throws an error, some of the storage functions I dont know yet how to get them from react-native-mmkv but may i know what the proper way to use this two together?
import {MMKV} from 'react-native-mmkv';
let options = {};
const StorageMMKV = {
config: customOptions => {
options = {
...options,
...customOptions,
};
},
setItem: (key, value, cb) => {
MMKV.set(key, value);
cb(null, value);
},
multiSet: (value, cb) => {
cb(null, value);
},
getItem: (key, cb) => {
const value = MMKV.getString(key);
cb(null, value);
},
removeItem: (key, cb) => {
MMKV.delete(key);
cb(null, key);
},
getAllKeys: cb => {
const keys = MMKV.getAllKeys();
cb(null, keys);
},
mergeItem: (key, cb) => {
cb(null, key);
},
multiGet: (keys, cb) => {
cb(null, keys);
},
multiSet: (keyValuePairs, cb) => {
cb(null, keyValuePairs);
},
multiRemove: (keys, cb) => {
cb(null, keys);
},
multiMerge: (keyValuePairs, cb) => {
cb(null, keyValuePairs);
},
clear: cb => {
MMKV.clearAll();
cb(null, true);
},
};
export {StorageMMKV};
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels