ModuleBuilder/moduleWrappers/powercord/util.js

16 lines
321 B
JavaScript
Raw Normal View History

2021-04-22 20:02:11 +00:00
const sleep = (ms) => new Promise(resolve => setTimeout(resolve, ms));
2021-04-05 09:44:44 +00:00
module.exports = {
2021-04-22 20:02:11 +00:00
sleep,
waitFor: async (query) => {
while (true) {
const el = document.querySelector(query);
if (el) return el;
await sleep(5);
}
},
2021-04-05 09:44:44 +00:00
...goosemodScope.reactUtils // Export GooseMod React utils
};