sp core library.servicescope.createdefaultandprovide - microsoft/Viva-Connections-Extensibility-Beta GitHub Wiki
Home > @microsoft/sp-core-library > ServiceScope > createDefaultAndProvide
This is a shorthand function that constructs the default implementation of the specified serviceKey, and then registers it by calling ServiceScope.provide().
Signature:
createDefaultAndProvide<T>(serviceKey: ServiceKey<T>): T;| Parameter | Type | Description |
|---|---|---|
| serviceKey | ServiceKey<T> | the key that can be used later to consume the service |
Returns:
T
a service instance that was constructed using ServiceKey.defaultCreator