createInjectionHooks
The createInjectionHooks(...tokens)
creates hooks for getting dependencies more easily.
#
Arguments...tokens
:TokenValue[]
.
#
Returns(() => TokenType<TokenValue>)[]
โ an array of hooks for getting dependencies.
#
Examplehooks.ts
UserComponent.tsx
This UserComponent
is the same as UserComponent
in the example in useInjection
section.
For more information about TOKENS.logger.optional
syntax,
see the Optional Dependencies documentation section.