summaryrefslogtreecommitdiff
path: root/source/libs/dom-utils.ts
diff options
context:
space:
mode:
authorGravatar Federico Brigante <github@bfred.it> 2019-05-28 13:56:27 +0800
committerGravatar Federico Brigante <github@bfred.it> 2019-05-28 13:56:27 +0800
commit6f0864f9b73568f46d7f2019d8ae54cad5b67bc8 (patch)
tree45219ddc04eab8a994beb5039c95b8332688749b /source/libs/dom-utils.ts
parent44c3bf314b655b31e23ab36aeead8077a2a8bf93 (diff)
downloadrefined-github-6f0864f9b73568f46d7f2019d8ae54cad5b67bc8.tar.gz
refined-github-6f0864f9b73568f46d7f2019d8ae54cad5b67bc8.tar.zst
refined-github-6f0864f9b73568f46d7f2019d8ae54cad5b67bc8.zip
Update `element-ready`
Diffstat (limited to '')
-rw-r--r--source/libs/dom-utils.ts16
1 files changed, 0 insertions, 16 deletions
diff --git a/source/libs/dom-utils.ts b/source/libs/dom-utils.ts
index 9b7a8941..eedd8921 100644
--- a/source/libs/dom-utils.ts
+++ b/source/libs/dom-utils.ts
@@ -1,20 +1,4 @@
import select from 'select-dom';
-import domLoaded from 'dom-loaded';
-import elementReady from 'element-ready';
-
-/*
- * Automatically stops checking for an element to appear once the DOM is ready.
- */
-export const safeElementReady = <T extends Element>(selector: string): Promise<T | null> => {
- const waiting = elementReady<T>(selector);
-
- // Don't check ad-infinitum
- // eslint-disable-next-line promise/prefer-await-to-then
- domLoaded.then(() => requestAnimationFrame(() => waiting.cancel()));
-
- // If cancelled, return null like a regular select() would
- return waiting.catch(() => null);
-};
/**
* Append to an element, but before a element that might not exist.