Parcourir la source

feat: new async storage function

Oleksandr Honcharov il y a 1 an
Parent
commit
d983a4d374
1 fichiers modifiés avec 5 ajouts et 1 suppressions
  1. 5 1
      src/storage/async-storage.ts

+ 5 - 1
src/storage/async-storage.ts

@@ -1,9 +1,13 @@
 import AsyncStorage from '@react-native-async-storage/async-storage';
 
 export const storageGet = (key: string) => {
-  return AsyncStorage.getItem(key).then((data) => data);
+  return AsyncStorage.getItem(key);
 };
 
 export const storageSet = (key: string, value: string) => {
   AsyncStorage.setItem(key, value).then();
 };
+
+export const storageDelete = (key: string) => {
+  AsyncStorage.removeItem(key).then();
+};