forked from MapComplete/MapComplete
Search: add support for osm.org urls such as osm.org/node/42
This commit is contained in:
parent
3ac2f96868
commit
3ab1a0a3f2
11 changed files with 118 additions and 35 deletions
|
@ -41,16 +41,16 @@ export class Stores {
|
|||
return src
|
||||
}
|
||||
|
||||
public static concat<T>(stores: Store<T[]>[]): Store<T[]> {
|
||||
const newStore = new UIEventSource<T[]>([])
|
||||
public static concat<T>(stores: Store<T[]>[]): Store<T[][]> {
|
||||
const newStore = new UIEventSource<T[][]>([])
|
||||
function update(){
|
||||
if(newStore._callbacks.isDestroyed){
|
||||
return true // unregister
|
||||
}
|
||||
const results: T[] = []
|
||||
const results: T[][] = []
|
||||
for (const store of stores) {
|
||||
if(store.data){
|
||||
results.push(...store.data)
|
||||
results.push(store.data)
|
||||
}
|
||||
}
|
||||
newStore.setData(results)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue