Skip to content

function useProviders view code

useProviders(
    root: Root, 
    providers: { Provider<unknown> }
): Root

Given an array of providers, uses all providers to the root. When the root is started, used providers are resolved in topological loading order while lifecycles in providers are added as dependencies to be registered.

Parameters

root: Root

The root that should use the providers.

providers: { Provider }

The providers to be added.

Returns

Root

The same root for convenience.