vectorator() function
vectorator() function
Use functional programming with your vector
Signature
export declare function vectorator<T>(vector: Vector<T>): {
[Symbol.iterator](): Generator<T, void, unknown>;
forEach(iterator: (row: T) => void): void;
map<V>(transform: (item: T, index: number) => V): V[];
filter(predicate: (item: T) => boolean): T[];
};
Import
import { vectorator } from '@grafana/data';
Parameters
Parameter | Type | Description |
---|---|---|
vector | Vector<T> |
Returns:
{ [Symbol.iterator](): Generator<T, void, unknown>; forEach(iterator: (row: T) => void): void; map<V>(transform: (item: T, index: number) => V): V[]; filter(predicate: (item: T) => boolean): T[]; }