本文整理匯總了TypeScript中@ember/runloop.schedule函數的典型用法代碼示例。如果您正苦於以下問題:TypeScript schedule函數的具體用法?TypeScript schedule怎麽用?TypeScript schedule使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了schedule函數的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: appendTo
appendTo(selector: string | Simple.Element) {
let target;
if (this._environment.hasDOM) {
target = typeof selector === 'string' ? document.querySelector(selector) : selector;
} else {
target = selector;
}
schedule('render', this.renderer, 'appendOutletView', this, target);
}
示例2: sendEvent
activeObservers.forEach((observer, eventName) => {
if (!observer.tag.validate(observer.lastRevision)) {
let sendObserver = () => {
try {
sendEvent(target, eventName, [target, observer.path]);
} finally {
observer.tag = getChainTagsForKey(target, observer.path);
observer.lastRevision = observer.tag.value();
}
};
if (shouldSchedule) {
schedule('actions', sendObserver);
} else {
// TODO: we need to schedule eagerly in exactly one location (_internalReset),
// for query params. We should get rid of this ASAP
sendObserver();
}
}
});
示例3: didUpdateAttrs
didUpdateAttrs() {
schedule('render', () => this.mountElement());
}