本文整理匯總了TypeScript中@ember/runloop.run.backburner.schedule方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript run.backburner.schedule方法的具體用法?TypeScript run.backburner.schedule怎麽用?TypeScript run.backburner.schedule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@ember/runloop.run.backburner
的用法示例。
在下文中一共展示了run.backburner.schedule方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: unloadRecord
unloadRecord() {
if (this.isDestroyed) {
return;
}
this._destroyRelationships();
this.reset();
if (!this._scheduledDestroy) {
this._scheduledDestroy = run.backburner.schedule(
'destroy',
this,
'_cleanupOrphanedRecordDatas'
);
}
}
示例2: unloadRecord
/*
Unload the record for this internal model. This will cause the record to be
destroyed and freed up for garbage collection. It will also do a check
for cleaning up internal models.
This check is performed by first computing the set of related internal
models. If all records in this set are unloaded, then the entire set is
destroyed. Otherwise, nothing in the set is destroyed.
This means that this internal model will be freed up for garbage collection
once all models that refer to it via some relationship are also unloaded.
*/
unloadRecord() {
if (this.isDestroyed) {
return;
}
this.send('unloadRecord');
this.dematerializeRecord();
if (this._scheduledDestroy === null) {
this._scheduledDestroy = run.backburner.schedule(
'destroy',
this,
'_checkForOrphanedInternalModels'
);
}
}