File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed
Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ interface AsyncStore {
1212 find : ( key : string ) => any ;
1313 isInitialized : ( ) => boolean ;
1414 getId : ( ) => string | undefined ;
15+ getShortId : ( ) => string | undefined ;
1516}
1617
1718export default AsyncStore ;
Original file line number Diff line number Diff line change @@ -234,6 +234,18 @@ export function getId(): string | undefined {
234234 return activeDomain && activeDomain [ ID_KEY ] ;
235235}
236236
237+ /**
238+ * Gets the short unique domain id created for the current context / scope.
239+ *
240+ * @returns {(string | undefined) }
241+ */
242+ export function getShortId ( ) : string | undefined {
243+ const activeDomain = getActiveDomain ( ) ;
244+ const id = activeDomain && activeDomain [ ID_KEY ] ;
245+
246+ return id && id . substring ( 0 , 8 ) ;
247+ }
248+
237249/**
238250 * Get the store from the active domain.
239251 *
Original file line number Diff line number Diff line change @@ -199,6 +199,15 @@ export function getId(): string | undefined {
199199 return initializedAdapter && getInstance ( initializedAdapter ) . getId ( ) ;
200200}
201201
202+ /**
203+ * Gets the short unique domain id created for the current context / scope.
204+ *
205+ * @returns {(string | undefined) }
206+ */
207+ export function getShortId ( ) : string | undefined {
208+ return initializedAdapter && getInstance ( initializedAdapter ) . getShortId ( ) ;
209+ }
210+
202211/**
203212 * Get the adapter instance based on adapter type.
204213 *
You can’t perform that action at this time.
0 commit comments