Skip to content

function useProvider view code

useProvider(
    root: Root, 
    provider: Provider<unknown>
): Root

Uses the provider to be initialized when the root starts. When the root is started, used providers are resolved in topological loading order while lifecycles in the providers are added as dependencies to be registered.

Parameters

root: Root

The root that should use the provider.

provider: Provider

The provider to be providers.

Returns

Root

The same root for convenience.