I like this vscroll-native example. But I would like to use something different than innerHTML in createItemElement.
createItemElement is a fine default, but there would be some advantages if something like uhtml or lithtml were an option. (I prefer uhtml, but I am sure lithtml and others could be popular too.)
What if there was ScrollerFactory that is provided the desired renderer and returns a Scroller class with the applicable Template type for the renderer chosen?
- The existing
Scroller.prototype.createItemElement would be replaced with a createItemElement<TEMPLATE> that is provided to the ScrollerFactory and would have the same interface. But it would dictate the TEMPLATE type for the renderer used.
- As a default, the provided
createItemElement could be the same implementation as the existing Scroller.prototype.createItemElement, where the TEMPLATE generic would be set to the existing Template type.
Is this something you'd consider? If so, I am happy to see if this idea works and create a pull request. (I may have some flaws in my current thinking/idea, but my hope is that its mostly feasible and that I can work out problems if I pursue it.) I just want to proceed if the idea is not valued.
Alternatively I could use vscroll-native as an example and create my own implementation that uses my preferred renderer. But it feels like there is opportunity for reuse if there were a ScrollerFactory that provided the desired renderer.
I like this vscroll-native example. But I would like to use something different than
innerHTMLin createItemElement.createItemElementis a fine default, but there would be some advantages if something like uhtml or lithtml were an option. (I prefer uhtml, but I am sure lithtml and others could be popular too.)What if there was
ScrollerFactorythat is provided the desired renderer and returns aScrollerclass with the applicableTemplatetype for the renderer chosen?Scroller.prototype.createItemElementwould be replaced with acreateItemElement<TEMPLATE>that is provided to theScrollerFactoryand would have the same interface. But it would dictate theTEMPLATEtype for the renderer used.createItemElementcould be the same implementation as the existingScroller.prototype.createItemElement, where theTEMPLATEgeneric would be set to the existing Template type.Is this something you'd consider? If so, I am happy to see if this idea works and create a pull request. (I may have some flaws in my current thinking/idea, but my hope is that its mostly feasible and that I can work out problems if I pursue it.) I just want to proceed if the idea is not valued.
Alternatively I could use vscroll-native as an example and create my own implementation that uses my preferred renderer. But it feels like there is opportunity for reuse if there were a
ScrollerFactorythat provided the desired renderer.