Add addCallbackAndRunD which ignores undefeind and null values
This commit is contained in:
parent
5e84b00ca2
commit
d7e421efc9
1 changed files with 7 additions and 0 deletions
|
@ -159,4 +159,11 @@ export class UIEventSource<T> {
|
||||||
return newSource;
|
return newSource;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
addCallbackAndRunD(callback: (data :T ) => void) {
|
||||||
|
this.addCallbackAndRun(data => {
|
||||||
|
if(data !== undefined && data !== null){
|
||||||
|
callback(data)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue