summaryrefslogtreecommitdiff
path: root/source/libs/api.ts
diff options
context:
space:
mode:
authorGravatar Federico Brigante <github@bfred.it> 2019-05-26 15:37:59 +0800
committerGravatar Federico Brigante <github@bfred.it> 2019-05-26 15:37:59 +0800
commitef3fce5ccc1c3350eb73e5c0a12ec1c9137d11fb (patch)
tree9a2030e5f39834e6a20b987f6f38674bcfc8be28 /source/libs/api.ts
parentecb9919400463e5eb2381be95f538a28a98929e1 (diff)
downloadrefined-github-ef3fce5ccc1c3350eb73e5c0a12ec1c9137d11fb.tar.gz
refined-github-ef3fce5ccc1c3350eb73e5c0a12ec1c9137d11fb.tar.zst
refined-github-ef3fce5ccc1c3350eb73e5c0a12ec1c9137d11fb.zip
Replace `p-memoize` wrapper with `mem`19.5.26.1924
Diffstat (limited to 'source/libs/api.ts')
-rw-r--r--source/libs/api.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/libs/api.ts b/source/libs/api.ts
index 3bd87c0a..bf5e9149 100644
--- a/source/libs/api.ts
+++ b/source/libs/api.ts
@@ -24,7 +24,7 @@ it lets you define accept error HTTP codes as a valid response, like:
so the call will not throw an error but it will return as usual.
*/
-import pMemoize from 'p-memoize';
+import mem from 'mem';
import OptionsSync from 'webext-options-sync';
import {JsonObject} from 'type-fest';
@@ -70,7 +70,7 @@ const v3defaults: GHRestApiOptions = {
body: undefined
};
-export const v3 = pMemoize(async (
+export const v3 = mem(async (
query: string,
options: GHRestApiOptions = v3defaults
): Promise<AnyObject> => {
@@ -98,7 +98,7 @@ export const v3 = pMemoize(async (
throw getError(apiResponse);
});
-export const v4 = pMemoize(async (query: string): Promise<AnyObject> => {
+export const v4 = mem(async (query: string): Promise<AnyObject> => {
const {personalToken} = await settings;
if (!personalToken) {