forked from MapComplete/MapComplete
More work on splitting roads, WIP; refactoring tests
This commit is contained in:
parent
e374bb355c
commit
1f93923820
62 changed files with 1163 additions and 823 deletions
|
@ -60,7 +60,12 @@ export class UIEventSource<T> {
|
|||
|
||||
run();
|
||||
return source;
|
||||
|
||||
}
|
||||
|
||||
public static FromPromise<T>(promise : Promise<T>): UIEventSource<T>{
|
||||
const src = new UIEventSource<T>(undefined)
|
||||
promise.then(d => src.setData(d))
|
||||
return src
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -191,6 +196,14 @@ export class UIEventSource<T> {
|
|||
}
|
||||
})
|
||||
}
|
||||
|
||||
addCallbackD(callback: (data: T) => void) {
|
||||
this.addCallback(data => {
|
||||
if (data !== undefined && data !== null) {
|
||||
return callback(data)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
export class UIEventSourceTools {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue