当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript ember-metal.backburner类代码示例

本文整理汇总了TypeScript中ember-metal.backburner的典型用法代码示例。如果您正苦于以下问题:TypeScript backburner类的具体用法?TypeScript backburner怎么用?TypeScript backburner使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了backburner类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: resolveRenderPromise

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

    backburner.join(null, resolve);
  }
}
开发者ID:jrjohnson,项目名称: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:jrjohnson,项目名称:ember.js,代码行数:13,代码来源:renderer.ts

示例3: loopEnd

function loopEnd() {
  for (let i = 0; i < renderers.length; i++) {
    if (!renderers[i]._isValid()) {
      if (loops > 10) {
        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:jrjohnson,项目名称:ember.js,代码行数:16,代码来源:renderer.ts

示例4: _scheduleRevalidate

 _scheduleRevalidate() {
   backburner.scheduleOnce('render', this, this._revalidate);
 }
开发者ID:jrjohnson,项目名称:ember.js,代码行数:3,代码来源:renderer.ts

示例5: Error

    if (!renderers[i]._isValid()) {
      if (loops > 10) {
        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:jrjohnson,项目名称:ember.js,代码行数:31,代码来源:renderer.ts


注:本文中的ember-metal.backburner类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。