kutaisan-react-native-mmkv-storage
Version:
This library aims to provide a fast & reliable solution for you data storage needs in react-native apps. It uses [MMKV](https://github.com/Tencent/MMKV) by Tencent under the hood on Android and iOS both that is used by their WeChat app(more than 1 Billion
45 lines (43 loc) • 748 B
JavaScript
export const types = ["string", "number", "boolean", "object", "array"];
export const methods = {
string: {
indexer: "strings",
get: "getString",
set: "setString",
copy:value => {
return value;
}
},
number: {
indexer: "numbers",
get: "getInt",
set: "setInt",
copy:value => {
return value;
}
},
boolean: {
indexer: "booleans",
get: "getBool",
set: "setBool",
copy:value => {
return value;
}
},
object: {
indexer: "maps",
get: "getMap",
set: "setMap",
copy:(value) => {
return {...value}
}
},
array: {
indexer: "arrays",
get: "getArray",
set: "setArray",
copy:(value) => {
return [...value]
}
},
};