forked from MapComplete/MapComplete
Feature(search): add error message if search failed
This commit is contained in:
parent
20984d1a46
commit
0cbfa325f6
11 changed files with 138 additions and 50 deletions
|
@ -45,15 +45,16 @@ export class Stores {
|
|||
?.then((d) => src.setData(d))
|
||||
return src
|
||||
}
|
||||
|
||||
public static concat<T>(stores: Store<T[] | undefined>[]): Store<(T[] | undefined)[]> {
|
||||
const newStore = new UIEventSource<(T[] | undefined)[]>([])
|
||||
public static concat<T>(stores: Store<T | undefined>[]): Store<(T | undefined)[]> ;
|
||||
public static concat<T>(stores: Store<T>[]): Store<T[]> ;
|
||||
public static concat<T>(stores: Store<T | undefined>[]): Store<(T | undefined)[]> {
|
||||
const newStore = new UIEventSource<(T | undefined)[]>([])
|
||||
|
||||
function update() {
|
||||
if (newStore._callbacks.isDestroyed) {
|
||||
return true // unregister
|
||||
}
|
||||
const results: (T[] | undefined)[] = []
|
||||
const results: (T | undefined)[] = []
|
||||
for (const store of stores) {
|
||||
results.push(store.data)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue