| 19 | * @param session Current resolution session |
| 20 | */ |
| 21 | const resolve: ResolverFunction = ( |
| 22 | ctx: Context, |
| 23 | injection: Readonly<Injection>, |
| 24 | session: ResolutionSession, |
| 25 | ) => { |
| 26 | console.log('Context: %s Binding: %s', ctx.name, session.currentBinding!.key); |
| 27 | const targetName = ResolutionSession.describeInjection(injection).targetName; |
| 28 | console.log('Injection: %s', targetName); |
| 29 | return injection.member === 'prefix' ? new Date().toISOString() : 'John'; |
| 30 | }; |
| 31 | |
| 32 | /** |
| 33 | * A class with dependency injection |