當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript runloop.backburner類代碼示例

本文整理匯總了TypeScript中@ember/runloop.backburner的典型用法代碼示例。如果您正苦於以下問題:TypeScript backburner類的具體用法?TypeScript backburner怎麽用?TypeScript backburner使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了backburner類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: resolveRenderPromise

function resolveRenderPromise() {
  if (renderSettledDeferred !== null) {
    let resolve = renderSettledDeferred.resolve;
    renderSettledDeferred = null;

    backburner.join(null, resolve);
  }
}
開發者ID:habdelra,項目名稱:ember.js,代碼行數:8,代碼來源:renderer.ts

示例2: renderSettled

export function renderSettled() {
  if (renderSettledDeferred === null) {
    renderSettledDeferred = RSVP.defer();
    // if there is no current runloop, the promise created above will not have
    // a chance to resolve (because its resolved in backburner's "end" event)
    if (!getCurrentRunLoop()) {
      // ensure a runloop has been kicked off
      backburner.schedule('actions', null, K);
    }
  }

  return renderSettledDeferred.promise;
}
開發者ID:habdelra,項目名稱:ember.js,代碼行數:13,代碼來源:renderer.ts

示例3: loopEnd

function loopEnd() {
  for (let i = 0; i < renderers.length; i++) {
    if (!renderers[i]._isValid()) {
      if (loops > ENV._RERENDER_LOOP_LIMIT) {
        loops = 0;
        // TODO: do something better
        renderers[i].destroy();
        throw new Error('infinite rendering invalidation detected');
      }
      loops++;
      return backburner.join(null, K);
    }
  }
  loops = 0;
  resolveRenderPromise();
}
開發者ID:habdelra,項目名稱:ember.js,代碼行數:16,代碼來源:renderer.ts

示例4: ensureRunloop

export function ensureRunloop(): void {
  backburner.ensureInstance();
}
開發者ID:emberjs,項目名稱:ember.js,代碼行數:3,代碼來源:tags.ts

示例5: _scheduleRevalidate

 _scheduleRevalidate() {
   backburner.scheduleOnce('render', this, this._revalidate);
 }
開發者ID:habdelra,項目名稱:ember.js,代碼行數:3,代碼來源:renderer.ts

示例6: Error

    if (!renderers[i]._isValid()) {
      if (loops > ENV._RERENDER_LOOP_LIMIT) {
        loops = 0;
        // TODO: do something better
        renderers[i].destroy();
        throw new Error('infinite rendering invalidation detected');
      }
      loops++;
      return backburner.join(null, K);
    }
  }
  loops = 0;
  resolveRenderPromise();
}

backburner.on('begin', loopBegin);
backburner.on('end', loopEnd);

export abstract class Renderer {
  private _env: Environment;
  private _rootTemplate: any;
  private _viewRegistry: {
    [viewId: string]: Opaque;
  };
  private _destinedForDOM: boolean;
  private _destroyed: boolean;
  private _roots: RootState[];
  private _lastRevision: number;
  private _isRenderingRoots: boolean;
  private _removedRoots: RootState[];
  private _builder: IBuilder;
開發者ID:habdelra,項目名稱:ember.js,代碼行數:31,代碼來源:renderer.ts

示例7: ensureRunloop

function ensureRunloop() {
  if (hasViews()) {
    backburner.ensureInstance();
  }
}
開發者ID:GreatWizard,項目名稱:ember.js,代碼行數:5,代碼來源:tags.ts


注:本文中的@ember/runloop.backburner類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。