Skip to content

Commit

Permalink
fix(types): wrong void return type of multiGet (#767)
Browse files Browse the repository at this point in the history
Fix #764
  • Loading branch information
mtt87 authored Mar 16, 2022
1 parent ecda1c0 commit 6ba9d69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/AsyncStorage.native.ts
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ const AsyncStorage = ((): AsyncStorageStatic => {
reject: null as any,
};

const promiseResult = new Promise<readonly KeyValuePair[] | void>(
const promiseResult = new Promise<readonly KeyValuePair[]>(
(resolve, reject) => {
getRequest.resolve = resolve;
getRequest.reject = reject;
Expand Down
4 changes: 2 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down Expand Up @@ -125,7 +125,7 @@ export type AsyncStorageStatic = {
multiGet: (
keys: string[],
callback?: MultiGetCallback
) => Promise<readonly KeyValuePair[] | void>;
) => Promise<readonly KeyValuePair[]>;

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

0 comments on commit 6ba9d69

Please sign in to comment.