소스 검색

feat: new async storage function

Oleksandr Honcharov 1 년 전
부모
커밋
d983a4d374
1개의 변경된 파일5개의 추가작업 그리고 1개의 파일을 삭제
  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();
+};