forked from MapComplete/MapComplete
Use addCallbackAndRunD
This commit is contained in:
parent
8d9a992507
commit
ba04beab2c
4 changed files with 5 additions and 12 deletions
|
@ -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)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue