-
Notifications
You must be signed in to change notification settings - Fork 5
sp core library.servicekey.id
Home > @microsoft/sp-core-library > ServiceKey > id
A unique identifier for this service key.
Signature:
readonly id: string;
This identifier is an automatically generated string that will be unique for the lifetime of the page. Callers should not make assumptions about the formatting of this string. It is currently based on a global counter, but this may change in the future.
The ServiceScope uses this identifier internally as a dictionary key for finding services. The ServiceKey is meant to be unique, even if multiple instances of the same library are loaded on the same page, even if the same name was passed to ServiceKey.create(). This is because each call to ServiceKey.create() could potentially provide a different defaultCreator implementation, whereas one of the design goals of ServiceScope is that the order in which libraries are loaded should never affect the resulting tree of scopes.