UNPKG

804 BJavaScriptView Raw
1"use strict";
2
3var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4Object.defineProperty(exports, "__esModule", {
5 value: true
6});
7exports.default = useFixedInfo;
8var _useMemo = _interopRequireDefault(require("rc-util/lib/hooks/useMemo"));
9var _isEqual = _interopRequireDefault(require("rc-util/lib/isEqual"));
10var _fixUtil = require("../utils/fixUtil");
11function useFixedInfo(flattenColumns, stickyOffsets, direction) {
12 var fixedInfoList = flattenColumns.map(function (_, colIndex) {
13 return (0, _fixUtil.getCellFixedInfo)(colIndex, colIndex, flattenColumns, stickyOffsets, direction);
14 });
15 return (0, _useMemo.default)(function () {
16 return fixedInfoList;
17 }, [fixedInfoList], function (prev, next) {
18 return !(0, _isEqual.default)(prev, next);
19 });
20}
\No newline at end of file