Class: DomPatcher

DomPatcher()

Handles patching the DOM with new HTML content using a simple diffing algorithm. This approach is more efficient than innerHTML as it preserves existing DOM nodes.

Constructor

new DomPatcher()

Source:

Methods

patch(target, html)

Patches the target element with the provided HTML.

Parameters:
Name Type Description
target Element

The element to patch.

html string

The new HTML content.

Source:

patchElement(oldElement, newElement)

Patches an existing element with a new element structure in-place.

Parameters:
Name Type Description
oldElement Element

The existing element.

newElement Element

The new element structure.

Source: