Further refactoring of the tests
This commit is contained in:
parent
3ab373f6ec
commit
2dac893bb3
31 changed files with 2498 additions and 2992 deletions
|
@ -158,10 +158,11 @@ export class UIEventSource<T> {
|
|||
)
|
||||
}
|
||||
|
||||
public AsPromise(): Promise<T> {
|
||||
public AsPromise(condition?: ((t: T )=> boolean)): Promise<T> {
|
||||
const self = this;
|
||||
condition = condition ?? (t => t !== undefined)
|
||||
return new Promise((resolve, reject) => {
|
||||
if (self.data !== undefined) {
|
||||
if (condition(self.data)) {
|
||||
resolve(self.data)
|
||||
} else {
|
||||
self.addCallbackD(data => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue