MCPcopy Create free account
hub / github.com/apitable/apitable / useCacheScroll

Function useCacheScroll

packages/datasheet/src/pc/context/scroll_context.ts:44–54  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

42} as IScrollContextProps);
43
44export const useCacheScroll = (): Required<IScrollOffset> & Pick<IScrollContextProps, 'changeCacheScroll'> => {
45 const { cacheScrollMap, changeCacheScroll } = useContext(ScrollContext) || {};
46 const { datasheetId, viewId } = useAppSelector((state) => state.pageParams);
47 const defaultValue = { scrollLeft: 0, scrollTop: 0, changeCacheScroll };
48 return cacheScrollMap.current && cacheScrollMap.current[`${datasheetId},${viewId}`]
49 ? {
50 ...defaultValue,
51 ...cacheScrollMap.current[`${datasheetId},${viewId}`],
52 }
53 : defaultValue;
54};

Callers 5

field_menu.tsxFile · 0.90
DragFunction · 0.90
useFieldOperateFunction · 0.90
useActiveFieldSettingFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected