AsyncStorageUtils.ts 441 B

12345678910111213141516
  1. import { AsyncStorage } from 'react-native';
  2. const addAsyncStorage = async (key, value) => {
  3. await AsyncStorage.setItem(key, value);
  4. return true;
  5. };
  6. const removeAsyncStorage = async (key) => {
  7. await AsyncStorage.removeItem(key);
  8. return true;
  9. };
  10. const getAsyncStorage = async (key) => {
  11. const val = await AsyncStorage.getItem(key);
  12. return val;
  13. };
  14. export { addAsyncStorage, removeAsyncStorage, getAsyncStorage };