Skip to content

Instantly share code, notes, and snippets.

@gatebuildr
gatebuildr / waitForIt.js
Last active October 12, 2024 19:39 — forked from lndr27/waitForIt.js
JS Wait for condition promise
(function (window) {
window.waitForIt = (predicate, options) => {
if (typeof predicate !== 'function') {
throw new Error('predicate must be a function')
}
return new Promise((resolve, reject) => {
_waitForTryAgain({
resolve,
reject,