extensions/amp-list/0.1/amp-list.js
/**
   * Renders the items stored in `this.renderItems_`. If its value changes
   * by the time render completes, schedules another render pass.
   * @private
   */
Renders the items stored in `this.renderItems_`. If its value changes
by the time render completes, schedules another render pass.
@private
Renders the items stored in ` this . renderItems_ ` . If its value changes by the time render completes schedules another render pass . @private
doRenderPass_() {
    const current = this.renderItems_;
    dev().assert(current && current.data, 'Nothing to render.');
    dev().info(TAG, 'pass:', current);
    const scheduleNextPass = () => {
      if (this.renderItems_ !== current) {
        this.renderPass_.schedule(1); 
      } else {
        this.renderedItems_ = this.renderItems_.data;
        this.renderItems_ = null;
      }
    };
    const onFulfilledCallback = () => {
      scheduleNextPass();
      current.resolver();
    };
    const onRejectedCallback = () => {
      scheduleNextPass();
      current.rejecter();
    };
    if (this.ssrTemplateHelper_.isSupported()) {
      const html =  (current.data);
      this.templates_.findAndSetHtmlForTemplate(this.element, html)
          .then(element => this.render_([element], current.append))
          .then(onFulfilledCallback, onRejectedCallback);
    } else {
      const array =  (current.data);
      this.templates_.findAndRenderTemplateArray(this.element, array)
          .then(results => this.updateBindings_(results))
          .then(elements => this.render_(elements, current.append))
          .then(() => this.loadMoreEnabled_ && this.setLoadMore_())
          .then(onFulfilledCallback, onRejectedCallback);
    }
  }
doRenderPass_ ( ) { const current = this . renderItems_ ; dev ( ) . assert ( current && current . data , 'Nothing to render.' ) ; dev ( ) . info ( TAG , 'pass:' , current ) ; const scheduleNextPass = ( ) => { if ( this . renderItems_ !== current ) { this . renderPass_ . schedule ( 1 ) ; } else { this . renderedItems_ = this . renderItems_ . data ; this . renderItems_ = null ; } } ; const onFulfilledCallback = ( ) => { scheduleNextPass ( ) ; current . resolver ( ) ; } ; const onRejectedCallback = ( ) => { scheduleNextPass ( ) ; current . rejecter ( ) ; } ; if ( this . ssrTemplateHelper_ . isSupported ( ) ) { const html = ( current . data ) ; this . templates_ . findAndSetHtmlForTemplate ( this . element , html ) . then ( element => this . render_ ( [ element ] , current . append ) ) . then ( onFulfilledCallback , onRejectedCallback ) ; } else { const array = ( current . data ) ; this . templates_ . findAndRenderTemplateArray ( this . element , array ) . then ( results => this . updateBindings_ ( results ) ) . then ( elements => this . render_ ( elements , current . append ) ) . then ( ( ) => this . loadMoreEnabled_ && this . setLoadMore_ ( ) ) . then ( onFulfilledCallback , onRejectedCallback ) ; } }
Renders the items stored in `this.renderItems_`.
Renders the items stored in ` this . renderItems_ ` .
// If there's a new `renderItems_`, schedule it for render. // Allow paint frame before next render. /** @type {string} */ /** @type {!Array} */