2021-09-21 02:10:42 +02:00
|
|
|
import FeatureSource from "../FeatureSource";
|
|
|
|
import {UIEventSource} from "../../UIEventSource";
|
|
|
|
import State from "../../../State";
|
2021-12-05 05:20:33 +01:00
|
|
|
import ElementsState from "../../State/ElementsState";
|
|
|
|
import {ElementStorage} from "../../ElementStorage";
|
2021-04-18 14:24:30 +02:00
|
|
|
|
2021-09-20 17:14:55 +02:00
|
|
|
export default class RegisteringAllFromFeatureSourceActor {
|
2021-05-10 23:51:03 +02:00
|
|
|
public readonly features: UIEventSource<{ feature: any; freshness: Date }[]>;
|
|
|
|
public readonly name;
|
|
|
|
|
2021-12-05 05:20:33 +01:00
|
|
|
constructor(source: FeatureSource, allElements: ElementStorage) {
|
2021-04-18 14:24:30 +02:00
|
|
|
this.features = source.features;
|
2021-05-10 23:51:03 +02:00
|
|
|
this.name = "RegisteringSource of " + source.name;
|
2021-06-30 16:02:46 +02:00
|
|
|
this.features.addCallbackAndRunD(features => {
|
|
|
|
for (const feature of features) {
|
2021-12-05 05:20:33 +01:00
|
|
|
allElements.addOrGetElement(feature.feature)
|
2021-04-18 14:24:30 +02:00
|
|
|
}
|
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|