lite-html
lite-html copied to clipboard
Refactor previousValue tracking in NodePart
Currently previousValue is used in the individual _render helpers, but set globally in the render function. It doesn't work as intended for _renderPrimitive, and there are some other issues. It would also be nice if render itself could exit early if it detects no value change.
Probably the way to go is checking for TemplateResult and Iterable first, then having a single guard for value === previousValue for the other render types. The main complexity is figuring out a correct solution for _renderPromise.