mirror of https://github.com/ghostfolio/ghostfolio
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
1.2 KiB
52 lines
1.2 KiB
import * as i0 from '@angular/core';
|
|
import { Injectable } from '@angular/core';
|
|
|
|
class UniqueSelectionDispatcher {
|
|
_listeners = [];
|
|
notify(id, name) {
|
|
for (let listener of this._listeners) {
|
|
listener(id, name);
|
|
}
|
|
}
|
|
listen(listener) {
|
|
this._listeners.push(listener);
|
|
return () => {
|
|
this._listeners = this._listeners.filter(registered => {
|
|
return listener !== registered;
|
|
});
|
|
};
|
|
}
|
|
ngOnDestroy() {
|
|
this._listeners = [];
|
|
}
|
|
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
minVersion: "12.0.0",
|
|
version: "21.0.3",
|
|
ngImport: i0,
|
|
type: UniqueSelectionDispatcher,
|
|
deps: [],
|
|
target: i0.ɵɵFactoryTarget.Injectable
|
|
});
|
|
static ɵprov = i0.ɵɵngDeclareInjectable({
|
|
minVersion: "12.0.0",
|
|
version: "21.0.3",
|
|
ngImport: i0,
|
|
type: UniqueSelectionDispatcher,
|
|
providedIn: 'root'
|
|
});
|
|
}
|
|
i0.ɵɵngDeclareClassMetadata({
|
|
minVersion: "12.0.0",
|
|
version: "21.0.3",
|
|
ngImport: i0,
|
|
type: UniqueSelectionDispatcher,
|
|
decorators: [{
|
|
type: Injectable,
|
|
args: [{
|
|
providedIn: 'root'
|
|
}]
|
|
}]
|
|
});
|
|
|
|
export { UniqueSelectionDispatcher };
|
|
//# sourceMappingURL=_unique-selection-dispatcher-chunk.mjs.map
|
|
|