We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a901b98 commit cce0708Copy full SHA for cce0708
dist/rilti.js
@@ -1407,11 +1407,17 @@
1407
return el
1408
}
1409
1410
- const componentReady = (el, fn) => run(() => {
+ const componentReady = (el, fn) => new Promise(resolve => run(() => {
1411
el = $(el)
1412
- if (el.componentReady) return fn(el)
1413
- el.once.componentReady(e => fn(el))
1414
- })
+ if (el.componentReady) {
+ resolve(el)
+ if (fn) return fn(el)
1415
+ }
1416
+ el.once.componentReady(e => {
1417
1418
+ if (fn) fn(el)
1419
+ })
1420
+ }))
1421
1422
exports.isArr = isArr
1423
exports.isComponent = isComponent
0 commit comments