MCPcopy Create free account
hub / github.com/plotly/dash / getter

Function getter

components/dash-table/src/dash-table/derived/selects/rows.ts:4–21  ·  view source on GitHub ↗
(indices: Indices, selectedRows: Indices)

Source from the content-addressed store, hash-verified

2import {memoizeOneFactory} from 'core/memoizer';
3
4const getter = (indices: Indices, selectedRows: Indices): Indices => {
5 const map = new Map<number, number>();
6
7 indices.forEach((virtualIndex, index) => {
8 map.set(virtualIndex, index);
9 });
10
11 const mappedSelectedRows: number[] = [];
12 selectedRows.forEach(rowIndex => {
13 const virtualIndex = map.get(rowIndex);
14
15 if (virtualIndex !== undefined) {
16 mappedSelectedRows.push(virtualIndex);
17 }
18 });
19
20 return mappedSelectedRows;
21};
22
23export default memoizeOneFactory(getter);

Callers

nothing calls this directly

Calls 3

pushMethod · 0.80
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…