MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / main

Function main

examples/context/src/custom-inject-decorator.ts:28–34  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

26}
27
28export async function main() {
29 const ctx = new Context('invocation-context');
30 ctx.bind(CURRENT_USER).to('John');
31 ctx.bind('greeter').toClass(Greeter);
32 const greeter = await ctx.get<Greeter>('greeter');
33 console.log(greeter.hello());
34}
35
36if (require.main === module) {
37 main().catch(err => {

Callers 1

Calls 5

bindMethod · 0.95
toMethod · 0.80
toClassMethod · 0.80
logMethod · 0.65
helloMethod · 0.65

Tested by

no test coverage detected