Skip to content

Commit 6ba9d69

Browse files
authored
fix(types): wrong void return type of multiGet (#767)
Fix #764
1 parent ecda1c0 commit 6ba9d69

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/AsyncStorage.native.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ const AsyncStorage = ((): AsyncStorageStatic => {
269269
reject: null as any,
270270
};
271271

272-
const promiseResult = new Promise<readonly KeyValuePair[] | void>(
272+
const promiseResult = new Promise<readonly KeyValuePair[]>(
273273
(resolve, reject) => {
274274
getRequest.resolve = resolve;
275275
getRequest.reject = reject;

src/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export type MultiRequest = {
2323
keys: readonly string[];
2424
callback?: MultiGetCallback;
2525
keyIndex: number;
26-
resolve?: (result?: readonly KeyValuePair[]) => void;
26+
resolve?: (result: readonly KeyValuePair[]) => void;
2727
reject?: (error?: any) => void;
2828
};
2929

@@ -125,7 +125,7 @@ export type AsyncStorageStatic = {
125125
multiGet: (
126126
keys: string[],
127127
callback?: MultiGetCallback
128-
) => Promise<readonly KeyValuePair[] | void>;
128+
) => Promise<readonly KeyValuePair[]>;
129129

130130
/**
131131
* Use this as a batch operation for storing multiple key-value pairs. When

0 commit comments

Comments
 (0)