本文整理匯總了TypeScript中@aurelia/runtime.ICollectionObserver.unsubscribeBatched方法的典型用法代碼示例。如果您正苦於以下問題:TypeScript ICollectionObserver.unsubscribeBatched方法的具體用法?TypeScript ICollectionObserver.unsubscribeBatched怎麽用?TypeScript ICollectionObserver.unsubscribeBatched使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類@aurelia/runtime.ICollectionObserver
的用法示例。
在下文中一共展示了ICollectionObserver.unsubscribeBatched方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: unbind
public unbind(): void {
this.nodeObserver.disconnect();
this.nodeObserver = null;
if (this.arrayObserver) {
this.arrayObserver.unsubscribeBatched(this);
this.arrayObserver = null;
}
}
示例2: unbind
public unbind(): void {
if (this.arrayObserver) {
this.arrayObserver.unsubscribeBatched(this);
this.arrayObserver = null;
}
if (this.valueObserver) {
this.valueObserver.unsubscribe(this);
}
}
示例3: setValueCore
public setValueCore(newValue: unknown, flags: LifecycleFlags): void {
const isArray = Array.isArray(newValue);
if (!isArray && newValue !== null && newValue !== undefined && this.obj.multiple) {
throw new Error('Only null or Array instances can be bound to a multi-select.');
}
if (this.arrayObserver) {
this.arrayObserver.unsubscribeBatched(this);
this.arrayObserver = null;
}
if (isArray) {
this.arrayObserver = this.observerLocator.getArrayObserver(this.persistentFlags | flags, newValue as unknown[]);
this.arrayObserver.subscribeBatched(this);
}
this.synchronizeOptions();
this.notify(flags);
}
示例4: setValueCore
public setValueCore(newValue: unknown, flags: LifecycleFlags): void {
if (!this.valueObserver) {
this.valueObserver = this.obj['$observers'] && (this.obj['$observers'].model || this.obj['$observers'].value);
if (this.valueObserver) {
this.valueObserver.subscribe(this);
}
}
if (this.arrayObserver) {
this.arrayObserver.unsubscribeBatched(this);
this.arrayObserver = null;
}
if (this.obj.type === 'checkbox' && Array.isArray(newValue)) {
this.arrayObserver = this.observerLocator.getArrayObserver(this.persistentFlags | flags, newValue);
this.arrayObserver.subscribeBatched(this);
}
this.synchronizeElement();
}