Merge branch 'master' into develop

This commit is contained in:
Pieter Vander Vennet 2025-02-16 02:41:10 +01:00
commit 47f721f6e2
19 changed files with 239 additions and 230 deletions

View file

@ -50,6 +50,7 @@ export default class ThemeSource implements IndexedFeatureSource {
const features = (this.features = new UIEventSource<Feature[]>([]))
const featuresById = (this.featuresById = new UIEventSource(new Map()))
this.core = mvtAvailableLayers.mapD((mvtAvailableLayers) => {
this.core?.data?.destruct()
const core = new ThemeSourceCore(
layers,
featureSwitches,
@ -300,4 +301,9 @@ class ThemeSourceCore extends FeatureSourceMerger {
// await Promise.all(this.supportsForceDownload.map((i) => i.updateAsync()))
console.log("Done")
}
public destruct() {
this.features.destroy()
this.featuresById.destroy()
}
}

View file

@ -626,11 +626,9 @@ class MappedStore<TIn, T> extends Store<T> {
}
private registerCallbacksToUpstream() {
const self = this
this._unregisterFromUpstream = this._upstream.addCallback((_) => self.update())
this._unregisterFromUpstream = this._upstream.addCallback((_) => this.update())
this._unregisterFromExtraStores = this._extraStores?.map((store) =>
store?.addCallback((_) => self.update())
store?.addCallback((_) => this.update())
)
this._callbacksAreRegistered = true
}