diff options
author | 2019-05-26 15:37:59 +0800 | |
---|---|---|
committer | 2019-05-26 15:37:59 +0800 | |
commit | ef3fce5ccc1c3350eb73e5c0a12ec1c9137d11fb (patch) | |
tree | 9a2030e5f39834e6a20b987f6f38674bcfc8be28 /source/libs/api.ts | |
parent | ecb9919400463e5eb2381be95f538a28a98929e1 (diff) | |
download | refined-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.ts | 6 |
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) { |