本文整理汇总了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);
}