本文整理汇总了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);
}
}
示例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;
}
示例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();
}
示例4: _scheduleRevalidate
_scheduleRevalidate() {
backburner.scheduleOnce('render', this, this._revalidate);
}
示例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;