Add search previews on the map

This commit is contained in:
Pieter Vander Vennet 2024-08-23 02:16:24 +02:00
parent 1c46a65c84
commit 4f52483a98
19 changed files with 315 additions and 87 deletions

View file

@ -91,6 +91,20 @@ export class Stores {
})
return stable
}
/**
*
* Constructs a new store, but tries to keep the value 'defined'
* If a defined value was in the stream once, a defined value will be returned
* @param store
*/
static holdDefined<T>(store: Store<T | undefined>): Store<T | undefined> {
const newStore = new UIEventSource(store.data)
store.addCallbackD(t => {
newStore.setData(t)
})
return newStore
}
}
export abstract class Store<T> implements Readable<T> {