forked from MapComplete/MapComplete
Add search previews on the map
This commit is contained in:
parent
1c46a65c84
commit
4f52483a98
19 changed files with 315 additions and 87 deletions
|
@ -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> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue