Skip to content

WebReflection/hyperhtml-wire

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hyperhtml-wire

Build Status Coverage Status Greenkeeper badge WebReflection status

The persistent fragment like class used in hyperHTML.

This is particularly useful with domdiff so it's been extracted from hyperHTML itself..

If you're looking for a smaller, modern, faster, alternative, check µwire out 😉

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

About

The persistent fragment like class used in hyperHTML

Resources

License

Stars

Watchers

Forks

Packages

No packages published