##// END OF EJS Templates
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version
Added childContainer service to container services, ServiceContaier is destroyable, fixed browser Uuid version

File last commit:

r115:691199f665e0 ioc ts support
r146:f3f5c56d3b3e v1.4.0-rc5 default
Show More
ObservableValue.ts
35 lines | 816 B | video/mp2t | TypeScriptLexer
/ src / main / ts / ObservableValue.ts
import { Observable } from "./Observable";
import { IDestroyable } from "./interfaces";
import { argumentNotNull } from "./safe";
type Handler<T> = (x: T) => void;
export class ObservableValue<T> extends Observable<T> {
private _value: T;
constructor(initial: T) {
super();
this._value = initial;
}
getValue() {
return this._value;
}
setValue(value: T) {
if (this._value !== value) {
this._value = value;
this._notifyNext(value);
}
}
on(next: Handler<T>, error?: Handler<any>, complete?: () => void): IDestroyable {
argumentNotNull(next, "next");
try {
next(this._value);
} catch {
// suppress error
}
return super.on(next, error, complete);
}
}