JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 4665
  • Score
    100M100P100Q127943F
  • License ISC

The persistent fragment like class used in hyperHTML

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

Build Status Coverage Status WebReflection status

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.first; // first body element
wire.last;  // last body element

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.remove(false); // returns fragment with nodes only if not appended