本文整理匯總了TypeScript中@orbit/data.Source類的典型用法代碼示例。如果您正苦於以下問題:TypeScript Source類的具體用法?TypeScript Source怎麽用?TypeScript Source使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Source類的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。
示例1: _activateSource
_activateSource(source: Source) {
const listener = this._transformListeners[source.name] = (transform: Transform): Promise<void> => {
return this._review(source, transform.id);
};
source.on('transform', listener);
}
示例2: _deactivateSource
_deactivateSource(source: Source) {
const listener = this._transformListeners[source.name];
source.off('transform', listener);
delete this._transformListeners[source.name];
}
示例3: _removeListener
protected _removeListener(source: Source, event: string): void {
const listener = deepGet(this._eventListeners, [source.name, event]);
source.off(event, listener);
this._eventListeners[source.name][event] = null;
}
示例4: _addListener
protected _addListener(source: Source, event: string): void {
const listener = this._generateListener(source, event);
deepSet(this._eventListeners, [source.name, event], listener);
source.on(event, listener);
}