##// END OF EJS Templates
working on fluent configuration, di annotations removed
working on fluent configuration, di annotations removed

File last commit:

r134:511bcc634d65 ioc ts support
r134:511bcc634d65 ioc ts support
Show More
config.ts
23 lines | 866 B | video/mp2t | TypeScriptLexer
cin
working on fluent configuration, di annotations removed
r134 import { Services } from "./services";
import { configure } from "../di/traits";
import { LifetimeManager } from "../di/LifetimeManager";
cin
dependency builder proposal
r110
cin
working on fluent configuration, di annotations removed
r134 export const config = configure<Services>()
cin
working on fluent configuration
r133 .register("host", s => s.value("example.com"))
.register("bar2", bar2 => Promise.all([import("./Foo"), import("./Bar")])
.then(([{ Foo }, { Bar }]) => {
cin
working on fluent configuration, di annotations removed
r134 const lifetime = LifetimeManager.hierarchyLifetime();
cin
working on fluent configuration
r133 bar2.factory((resolve, activate) => {
const bar = new Bar({
foo: activate(lifetime, () => new Foo()),
nested: {
lazy: resolve("foo", { lazy: true })
},
host: resolve("host")
}, "some text");
bar.setName(resolve("host"));
return bar;
});
})
cin
working on fluent container configuration
r125 );