0.1.0 • Published 2 years ago

wait-elm v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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);
0.1.0

2 years ago