useInjection
The useInjection(token)
hook allows you to get a dependency
from a container provided through ContainerProvider
.
#
Argumentstoken
:TokenValue
.
#
ReturnsTokenType<TokenValue>
โ a dependency bound to the token.
#
ExampleThe binding of TOKENS.userService
was shown
in the example in ContainerProvider
section.
For more information about TOKENS.logger.optional
syntax,
see the Optional Dependencies documentation section.