From ef3fce5ccc1c3350eb73e5c0a12ec1c9137d11fb Mon Sep 17 00:00:00 2001 From: Federico Brigante Date: Sun, 26 May 2019 15:37:59 +0800 Subject: Replace `p-memoize` wrapper with `mem` --- source/libs/api.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/libs/api.ts') 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 => { @@ -98,7 +98,7 @@ export const v3 = pMemoize(async ( throw getError(apiResponse); }); -export const v4 = pMemoize(async (query: string): Promise => { +export const v4 = mem(async (query: string): Promise => { const {personalToken} = await settings; if (!personalToken) { -- cgit v1.2.3