MCPcopy
hub / github.com/algolia/autocomplete / getItemsCount

Function getItemsCount

packages/autocomplete-shared/src/getItemsCount.ts:1–12  ·  view source on GitHub ↗
(state: TAutocompleteState)

Source from the content-addressed store, hash-verified

1export function getItemsCount<
2 TAutocompleteState extends { collections: any[] }
3>(state: TAutocompleteState) {
4 if (state.collections.length === 0) {
5 return 0;
6 }
7
8 return state.collections.reduce<number>(
9 (sum, collection) => sum + collection.items.length,
10 0
11 );
12}

Callers 5

autocompleteFunction · 0.90
scheduleRenderFunction · 0.90
getDefaultPropsFunction · 0.90
stateReducerFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected