newMapForObjectWithIdentity()
Home > @gooddata/sdk-ui-dashboard > newMapForObjectWithIdentity
newMapForObjectWithIdentity() function
This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Creates ObjRefMap for any object of any type granted that it contains ref property with ObjRef.
The map will be setup so that it extracts id and uri from the ref - thus ensuring that objects that are both uri and identifier refs are indexed properly.
Storing objects whose ref is of both types then allows lookup of those objects externally using either id or uri.
Signature:
export declare function newMapForObjectWithIdentity<T extends {
identifier: Identifier;
uri: string;
ref: ObjRef;
}>(items: T[], type?: ObjectType, strictTypeCheck?: boolean): ObjRefMap<T>;
Parameters
|
Parameter |
Type |
Description |
|---|---|---|
|
items |
T[] |
items to insert |
|
type |
(Optional) type of objects, may be undefined | |
|
strictTypeCheck |
boolean |
(Optional) whether to do strict type checking when getting by identifierRef |
Returns:
ObjRefMap<T>