UNPKG

@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) 617 B
/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */import{noChange as e}from"../lit-html.js";import{directive as n,Directive as u}from"../directive.js";const a={};class p extends u{constructor(){super(...arguments),this._previousValue=a}render(i,r){return r()}update(i,[r,t]){if(Array.isArray(r)){if(Array.isArray(this._previousValue)&&this._previousValue.length===r.length&&r.every((s,o)=>s===this._previousValue[o]))return e}else if(this._previousValue===r)return e;return this._previousValue=Array.isArray(r)?Array.from(r):r,this.render(r,t)}}const d=n(p);export{d as guard};