ModuleBuilder/moduleWrappers/powercord/util.js

16 lines
No EOL
321 B
JavaScript

const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
module.exports = {
sleep,
waitFor: async (query) => {
while (true) {
const el = document.querySelector(query);
if (el) return el;
await sleep(5);
}
},
...goosemodScope.reactUtils // Export GooseMod React utils
};