##// END OF EJS Templates
Added safe.debounce function, this is a preview version
Added safe.debounce function, this is a preview version

File last commit:

r134:511bcc634d65 ioc ts support
r159:130129fdbd20 default
Show More
Box.ts
28 lines | 682 B | video/mp2t | TypeScriptLexer
import { Bar } from "./Bar";
// export service descriptor
// через service передается информация о типе зависимости
// даже если это шаблон.
// export const service = annotate<Box<Bar>>();
// @service.wire()
export class Box<T> {
private _value: T | undefined;
constructor(value?: T) {
this._value = value;
}
// @service.inject(dependency("bar"))
setValue(value: T) {
this._value = value;
return value;
}
getValue() {
if (this._value === undefined)
throw new Error("Trying to get a value from the empty box");
return this._value;
}
}