From aa47ad3986c39d7527b3cec00faa6cd2358fc18b Mon Sep 17 00:00:00 2001 From: Mattia Asti Date: Wed, 9 Mar 2022 17:20:00 +0000 Subject: [PATCH 1/3] Update types.ts Fix https://github.com/react-native-async-storage/async-storage/issues/764 --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 1eafd0ca..3624b474 100644 --- a/src/types.ts +++ b/src/types.ts @@ -125,7 +125,7 @@ export type AsyncStorageStatic = { multiGet: ( keys: string[], callback?: MultiGetCallback - ) => Promise; + ) => Promise; /** * Use this as a batch operation for storing multiple key-value pairs. When From 2b8efd1a028fb3edc1de24949397edbfaa1e3847 Mon Sep 17 00:00:00 2001 From: Mattia Asti Date: Thu, 10 Mar 2022 10:06:53 +0000 Subject: [PATCH 2/3] Fix promiseResult --- src/AsyncStorage.native.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AsyncStorage.native.ts b/src/AsyncStorage.native.ts index 9def456d..45673f1a 100644 --- a/src/AsyncStorage.native.ts +++ b/src/AsyncStorage.native.ts @@ -269,7 +269,7 @@ const AsyncStorage = ((): AsyncStorageStatic => { reject: null as any, }; - const promiseResult = new Promise( + const promiseResult = new Promise( (resolve, reject) => { getRequest.resolve = resolve; getRequest.reject = reject; From d63a7cf52b3e28b7915c6b1739abac30a808a672 Mon Sep 17 00:00:00 2001 From: Mattia Asti Date: Tue, 15 Mar 2022 11:47:50 +0000 Subject: [PATCH 3/3] Fix another type --- src/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/types.ts b/src/types.ts index 3624b474..a4e543da 100644 --- a/src/types.ts +++ b/src/types.ts @@ -23,7 +23,7 @@ export type MultiRequest = { keys: readonly string[]; callback?: MultiGetCallback; keyIndex: number; - resolve?: (result?: readonly KeyValuePair[]) => void; + resolve?: (result: readonly KeyValuePair[]) => void; reject?: (error?: any) => void; };