useProvided<T> function

T useProvided<T>()

Retrieves a provided value of type T and registers it as a dependency of the current HookContext.

Shorthand for ProviderContextExtensions.get on HookContext.current. Implementations should throw ProvidedValueNotFoundException when the requested value can't be provided.

Implementation

T useProvided<T>() => useContext().get<T>();