##// END OF EJS Templates
corrected code to support ts strict mode...
corrected code to support ts strict mode safe.ts - more tight typings - added notImplemented stub function - added fork funtion - added keys function (like Object.keys but extracts keys type) - added isKeyof typeguard - added 'primitive' union type added EventProvider for the observable

File last commit:

r115:691199f665e0 ioc ts support
r115:691199f665e0 ioc ts support
Show More
Bar.ts
33 lines | 615 B | video/mp2t | TypeScriptLexer
import { Foo } from "./Foo";
// import { config } from "./config";
// const service = config.build("bar");
// @service.consume({
// f: config.dependency("foo"),
// nested: {
// lazy: config.lazy("foo")
// }
// })
export class Bar {
barName = "bar";
_v: Foo | undefined;
constructor(_opts: {
foo: Foo;
nested: {
lazy: () => Foo
}
}) {
if (_opts && _opts.foo)
this._v = _opts.foo;
}
getFoo() {
if (this._v === undefined)
throw new Error("The foo isn't set");
return this._v;
}
}