Browse Source

feat: new async storage function

Oleksandr Honcharov 1 year ago
parent
commit
d983a4d374
1 changed files with 5 additions and 1 deletions
  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();
+};