James Wilson
unread,Sep 1, 2015, 7:08:08 PM9/1/15Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Elm Discuss
Hello!
I'm pretty new to Elm, having only used it for a weekend thus far writing a small app to see how it fares, but its pretty exciting and I can see it growing on me.
One thing I've had to do in an Angular app I work on is create an infinite scrolling list, so that we can sanely handle many thousands of items. My angular implementation allows flexbox to render outer elements for each item on the list of a known size, while hiding anything inside them to save adding additional elements to the DOM among other things.
A further optimisation to this would be to use absolute positioning, calculate positions based on container size, and only render the elements currently on screen, ignoring the rest entirely.
I cannot offhand see any way to get at underlying element information (width, height, position, scroll offset etc) that would be necessary to pull this sort of thing off in Elm. My feeling is that youd have to tag elements with some unique class, say, and use ports and some JS to provide this custom data back to Elm each time, say, the scroll or window dimensions change, so that the infinite list knows what to show/hide etc.
Being new to Elm I fear I may be missing something however. Is there a way to do this in-house without JS?
Thanks 😊
James