-
Notifications
You must be signed in to change notification settings - Fork 2
Description
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.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. - As a default, the provided
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 ScrollerFactory that provided the desired renderer.