@popeindustries/lit-html
Version:
Seamlessly and efficiently use @popeindustries/lit-html-server rendered HTML to hydrate lit-html templates in the browser
6 lines (5 loc) • 487 B
JavaScript
/**
* @license
* Copyright 2020 Google LLC
* SPDX-License-Identifier: BSD-3-Clause
*/import{noChange as t}from"../lit-html.js";import{directive as r,Directive as n,PartType as o}from"../directive.js";class i extends n{constructor(e){if(super(e),e.type!==o.CHILD)throw new Error("templateContent can only be used in child bindings")}render(e){return this._previousTemplate===e?t:(this._previousTemplate=e,document.importNode(e.content,!0))}}const m=r(i);export{m as templateContent};