Initial commit

This commit is contained in:
wuzhenyu
2025-08-27 19:20:10 +08:00
parent 9f5b8552a0
commit 8d7fd34e1a
35 changed files with 3983 additions and 114 deletions

26
storage/index.js Normal file
View File

@@ -0,0 +1,26 @@
// storage.js
import AsyncStorage from '@react-native-async-storage/async-storage';
const Storage = {
setItemAsync(key, value) {
return AsyncStorage.setItem(key, JSON.stringify(value || {}));
},
getItemAsync(key) {
return new Promise(resolve=>{
AsyncStorage.getItem(key).then(value=>{
resolve(value ? JSON.parse(value) : null)
})
})
},
removeItemAsync(key) {
return AsyncStorage.removeItem(key)
},
clearAllAsync() {
return AsyncStorage.clear();
}
};
export default Storage;