wireup
wireup copied to clipboard
Introduce functional deps
They can ask for dependencies as usual and return a function that will perform the task.
@container.functional
def greeter_factory(translator_service: TranslatorService, other_service ...) -> Callable...
def greeter(name: str, locale: str = 'en_GB') -> str:
return ...
return greeter
@container.autowire
def target(greeter: Annotated[Callable..., Wire(fn=greeter_factory))
...