MCPcopy Create free account
hub / github.com/adobe/react-spectrum / toArray

Function toArray

packages/react-stately/src/layout/ListLayout.ts:858–869  ·  view source on GitHub ↗
(
  collection: Collection<Node<T>>,
  predicate: (node: Node<T>) => boolean
)

Source from the content-addressed store, hash-verified

856}
857
858function toArray<T>(
859 collection: Collection<Node<T>>,
860 predicate: (node: Node<T>) => boolean
861): Node<T>[] {
862 const result: Node<T>[] = [];
863 for (const node of collection) {
864 if (predicate(node)) {
865 result.push(node);
866 }
867 }
868 return result;
869}

Callers 1

buildCollectionMethod · 0.70

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected