I’m working on an app with a text editor and a preview of the output from what you’ve typed in. There are options for the user to change the app’s layout in ways that move that preview to different parts of the page. The preview is expensive to render in terms of both time and resources.
Is there a way in Elm to accomplish something like
Html.Keyed, where the same item in a different position isn’t rerendered, but for something that isn’t just changing position in a list, but moving around to disparate parts of the DOM?
So far the best I’ve gotten is to render it in every part of the DOM where it could appear, but to
display: none the ones that aren’t currently active. This works (for the most part), but is more expensive than I’d like. Wondering if there are other/better tricks for this?