index.js
/**
   * Renders a template to a container.
   *
   * To update a container with new values, reevaluate the template literal and
   * call `render` with the new result.
   */
Renders a template to a container.
To update a container with new values, reevaluate the template literal and
call `render` with the new result.
Renders a template to a container . To update a container with new values reevaluate the template literal and call ` render ` with the new result .
function render(result, container, partCallback = defaultPartCallback) {
    let instance = container.__templateInstance;
    if (instance !== undefined && instance.template === result.template && instance._partCallback === partCallback) {
      instance.update(result.values);
      return;
    }
    instance = new TemplateInstance(result.template, partCallback);
    container.__templateInstance = instance;
    const fragment = instance._clone();
    instance.update(result.values);
    let child;
    while (child = container.lastChild) {
      container.removeChild(child);
    }
    container.appendChild(fragment);
  }
function render ( result , container , partCallback = defaultPartCallback ) { let instance = container . __templateInstance ; if ( instance !== undefined && instance . template === result . template && instance . _partCallback === partCallback ) { instance . update ( result . values ) ; return ; } instance = new TemplateInstance ( result . template , partCallback ) ; container . __templateInstance = instance ; const fragment = instance . _clone ( ) ; instance . update ( result . values ) ; let child ; while ( child = container . lastChild ) { container . removeChild ( child ) ; } container . appendChild ( fragment ) ; }
Renders a template to a container.
Renders a template to a container .
// Repeat render, just call update() // First render, create a new TemplateInstance and append it