add `asyncQuerySelector()` to core
I've created the asyncQuerySelector()
and asyncQuerySelectorAll()
functions that @Marjolaine uses to target elements that aren't yet in the DOM.
Indeed, with nested widgets, it's sometimes difficult to know when an element will be present in the DOM.
With these functions, all you need to do is:
const myButton = asyncQuerySelector('.mybutton')
myButton.addEventlistener('click', () => { ... })
or
const myApp = asyncQuerySelector('solid-myApp')
for await(const element of asyncQuerySelectorAll('solid-table solid-display.item', myApp) {
// we can handle each element the moment it appears in the DOM
}
these functions are very useful when working with widgets. Couldn't we include them in helpers?