This repository has been archived by the owner on Oct 23, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
sp core library.servicekey.create
John Nguyen edited this page Apr 22, 2021
·
2 revisions
Home > @microsoft/sp-core-library > ServiceKey > create
Constructs a new ServiceKey whose default implementation will be a new instance of a TypeScript class that accepts the standard constructor parameter.
Signature:
static create<TKey>(name: string, serviceClass: {
new (serviceScope: ServiceScope): TKey;
}): ServiceKey<TKey>;
Parameter | Type | Description |
---|---|---|
name | string | A name such as "my-package.IMyService" which should be unique across packages. |
serviceClass | { new (serviceScope: ServiceScope): TKey; } | the TypeScript class that implements the service. |
Returns:
ServiceKey<TKey>
the newly created ServiceKey
If you want to specify custom constructor parameters, use ServiceKey.createCustom() instead.