Package Exports
- hyperhtml-wire
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (hyperhtml-wire) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
hyperhtml-wire
The persistent fragment like class used in hyperHTML.
This is particularly useful with domdiff so it's been extracted from hyperHTML itself..
import Wire from 'hyperhtml-wire';
const wire = new Wire(document.body.querySelectorAll('*'));
wire.firstChild; // first body element
wire.lastChild; // last body element
wire.childNodes; // an array of initial nodes
wire.ownerDocument; // the document of the first child
wire.remove(true); // remove all but first node (domdiff friendly)
wire.remove(false); // remove all nodes
wire.valueOf(true); // force nodes to be re-appended to a fragment
wire.valueOf(false);// returns fragment with nodes only if not appended