bucketsFind()
Home > @gooddata/sdk-model > bucketsFind
bucketsFind() function
Finds bucket matching the provided predicate in a list of buckets.
Signature:
export declare function bucketsFind(buckets: IBucket[], idOrFun?: string | BucketPredicate): IBucket | undefined;
Parameters
Parameter |
Type |
Description |
---|---|---|
buckets |
IBucket[] |
list of buckets to search |
idOrFun |
string | BucketPredicate |
(Optional) bucket predicate or string to match bucket by local identifier; anyBucket is default |
Returns:
IBucket | undefined
Remarks
If no predicate is provided, then the function defaults to anyBucket predicate - meaning first bucket in the list will be returned.
This function also provides convenience to find bucket by local identifier - if you pass predicate as string the function will automatically create idMatchBucket predicate.