()
| 42 | } as IScrollContextProps); |
| 43 | |
| 44 | export 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 | }; |
no outgoing calls
no test coverage detected