summaryrefslogtreecommitdiff
path: root/source/libs/fetch-dom.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/fetch-dom.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 '')
-rw-r--r--source/libs/fetch-dom.ts7
1 files changed, 2 insertions, 5 deletions
diff --git a/source/libs/fetch-dom.ts b/source/libs/fetch-dom.ts
index f1a921fe..251c20af 100644
--- a/source/libs/fetch-dom.ts
+++ b/source/libs/fetch-dom.ts
@@ -1,8 +1,5 @@
import domify from 'doma';
-import pMemoize from 'p-memoize';
-
-// TODO: wait for https://github.com/sindresorhus/p-memoize/issues/9
-const memo = pMemoize as <T = VoidFunction>(fn: T) => T;
+import mem from 'mem';
async function fetchDom(url: string): Promise<DocumentFragment>;
async function fetchDom<TElement extends Element>(url: string, selector: string): Promise<TElement>;
@@ -13,4 +10,4 @@ async function fetchDom(url: string, selector?: string): Promise<Node> {
return selector ? dom.querySelector(selector)! : dom;
}
-export default memo(fetchDom);
+export default mem(fetchDom);