wait-elm
v0.1.0
Published
Asynchronously wait for HTML elements.
Downloads
13
Readme
wait-elm
Asynchronously wait for HTML elements.
import { wait } from "wait-elm";
run();
async function run() {
const elm = await wait("#my-element");
console.log(elm);
}
setTimeout(() => {
const elm = document.createElement("div");
elm.id = "my-element";
document.body.appendChild(elm);
}, 1000);