本文整理匯總了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);
}
}
示例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 > 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();
}
示例4: ensureRunloop
export function ensureRunloop(): void {
backburner.ensureInstance();
}
示例5: _scheduleRevalidate
_scheduleRevalidate() {
backburner.scheduleOnce('render', this, this._revalidate);
}
示例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;
示例7: ensureRunloop
function ensureRunloop() {
if (hasViews()) {
backburner.ensureInstance();
}
}