vscroll
Version:
Virtual scroll engine
29 lines • 933 B
JavaScript
import { AdapterPropName } from './props';
const getBox = (id) => {
var _a;
return (_a = wantedStorage.get(id || -1)) === null || _a === void 0 ? void 0 : _a.box;
};
const setBox = ({ name, wanted }, id) => {
const Wanted = wantedStorage.get(id || -1);
if (wanted && Wanted && !Wanted.box[name] && !Wanted.block) {
const { firstVisible: a, firstVisible$: a$ } = AdapterPropName;
const { lastVisible: b, lastVisible$: b$ } = AdapterPropName;
Wanted.box[a] = Wanted.box[a$] = [a, a$].some(n => n === name) || Wanted.box[a];
Wanted.box[b] = Wanted.box[b$] = [b, b$].some(n => n === name) || Wanted.box[b];
return true;
}
return false;
};
const setBlock = (value, id) => {
const Wanted = wantedStorage.get(id || -1);
if (Wanted) {
Wanted.block = value;
}
};
export const wantedUtils = {
getBox,
setBox,
setBlock
};
export const wantedStorage = new Map();
//# sourceMappingURL=wanted.js.map