How to use the injectable.container.injection_container.InjectionContainer._register_factory function in injectable

To help you get started, we’ve selected a few injectable examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github allrod5 / injectable / injectable / injection / injectable_factory_decorator.py View on Github external
def decorator(fn: Callable[..., T]) -> Callable[..., T]:
        caller_filepath = get_caller_filepath()
        if caller_filepath == InjectionContainer.LOADING_FILEPATH:
            InjectionContainer._register_factory(
                fn,
                caller_filepath,
                dependency,
                qualifier,
                primary,
                namespace,
                group,
                singleton,
            )
        return fn