Use addCallbackAndRunD

This commit is contained in:
Pieter Vander Vennet 2021-06-30 16:02:46 +02:00
parent 8d9a992507
commit ba04beab2c
4 changed files with 5 additions and 12 deletions

View file

@ -16,11 +16,7 @@ export default class LocalStorageSaver implements FeatureSource {
constructor(source: FeatureSource, layout: UIEventSource<LayoutConfig>) {
this.features = source.features;
this.features.addCallbackAndRun(features => {
if (features === undefined) {
return;
}
this.features.addCallbackAndRunD(features => {
const now = new Date().getTime()
features = features.filter(f => layout.data.cacheTimeout > Math.abs(now - f.freshness.getTime())/1000)