Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

streaksheet

Package Overview
Dependencies
Maintainers
4
Versions
142
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

streaksheet - npm Package Compare versions

Comparing version 0.9.6 to 0.9.7

build/src/ReleaseRowsRequestsBatcher.d.ts

6

build/src/index.js

@@ -38,2 +38,4 @@ "use strict";

var ReactDOM = _interopRequireWildcard(require("react-dom"));
var _reactWindow = require("react-window");

@@ -909,3 +911,5 @@

refreshRows: function refreshRows() {
sheetData.refreshRows();
ReactDOM.unstable_batchedUpdates(function () {
sheetData.refreshRows();
});
},

@@ -912,0 +916,0 @@ scrollTo: function scrollTo(scrollArgs) {

3

build/src/useRowsBySection.d.ts
import { RowsBySection, StartedRowsRequests, UnresolvedStartedRowsRequest } from './internalTypes';
import { DataHandler, ExposedRowsResult, LocalRowMutation, Section } from './useSheetData';
import ReleaseRowsRequestsBatcher from './ReleaseRowsRequestsBatcher';
export interface RowsBySectionOptions<T> {

@@ -12,3 +13,3 @@ mutations: Array<LocalRowMutation<T>>;

createRowsRequest(sectionKey: string, request: UnresolvedStartedRowsRequest, storeResult?: boolean): Promise<ExposedRowsResult<T> | undefined>;
releaseRowsRequests(sectionKey: string, requestIndexes?: number[]): void;
releaseRowsRequestsBatcher: ReleaseRowsRequestsBatcher;
reset(): void;

@@ -15,0 +16,0 @@ rowsBySection: RowsBySection<T>;

@@ -28,2 +28,4 @@ "use strict";

var ReactDOM = _interopRequireWildcard(require("react-dom"));
var _assertNever = _interopRequireDefault(require("./assertNever"));

@@ -33,2 +35,4 @@

var _ReleaseRowsRequestsBatcher = _interopRequireDefault(require("./ReleaseRowsRequestsBatcher"));
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }

@@ -554,2 +558,3 @@

return function () {
// eslint-disable-next-line react-hooks/exhaustive-deps
for (var _i8 = 0, _Object$values = Object.values(startedRowsRequests.current); _i8 < _Object$values.length; _i8++) {

@@ -578,3 +583,3 @@ var requests = _Object$values[_i8];

};
}, [startedRowsRequests]); // This function only counts remote rows, NOT mutations
}, []); // This function only counts remote rows, NOT mutations
// This should be used for request logic

@@ -590,3 +595,4 @@

}, [rowsBySection]);
var releaseRowsRequests = (0, _react.useCallback)(function (sectionKey, requestIndexes) {
var _releaseRowsRequests = (0, _react.useCallback)(function (sectionKey, requestIndexes) {
var recalcNeeded = false;

@@ -617,6 +623,8 @@

if (recalcNeeded) {
recalculateRemoteRowsBySection();
}
}, [recalculateRemoteRowsBySection]);
return recalcNeeded;
}, []);
var releaseRowsRequestsBatcher = (0, _react.useMemo)(function () {
return new _ReleaseRowsRequestsBatcher["default"](recalculateRemoteRowsBySection, _releaseRowsRequests);
}, [recalculateRemoteRowsBySection, _releaseRowsRequests]);
var rightShiftRequests = (0, _react.useCallback)(function (sectionKey, rightShiftAmount) {

@@ -723,4 +731,5 @@ if (rightShiftAmount <= 0) {

if (invalidIndexes.length > 0) {
releaseRowsRequests(sectionKey, invalidIndexes);
refreshColumnAndOverviewData();
releaseRowsRequestsBatcher.batchReleases(function (releaseRowsRequests) {
releaseRowsRequests(sectionKey, invalidIndexes);
});
}

@@ -775,3 +784,3 @@ } // Case 4: We need to shift all results to the right by one if

recalculateRemoteRowsBySection();
}, [dataHandler.firstPageCursor, dataHandler.lastPageCursor, recalculateRemoteRowsBySection, refreshColumnAndOverviewData, releaseRowsRequests, removeDuplicates, rightShiftRequests, sections]);
}, [dataHandler.firstPageCursor, dataHandler.lastPageCursor, recalculateRemoteRowsBySection, refreshColumnAndOverviewData, releaseRowsRequestsBatcher, removeDuplicates, rightShiftRequests, sections]);
var createRowsRequest = (0, _react.useCallback)( /*#__PURE__*/function () {

@@ -808,3 +817,9 @@ var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(sectionKey, request) {

rowsResult = _context.sent;
storeResult && storeRowsForRequest(rowsResult, sectionKey, request);
if (storeResult) {
ReactDOM.unstable_batchedUpdates(function () {
storeRowsForRequest(rowsResult, sectionKey, request);
});
}
return _context.abrupt("return", rowsResult);

@@ -836,10 +851,9 @@

var reset = (0, _react.useCallback)(function () {
for (var _i10 = 0, _Object$keys = Object.keys(startedRowsRequests.current); _i10 < _Object$keys.length; _i10++) {
var _sectionKey4 = _Object$keys[_i10];
releaseRowsRequests(_sectionKey4);
}
startedRowsRequests.current = {};
recalculateRemoteRowsBySection();
}, [recalculateRemoteRowsBySection, releaseRowsRequests]);
releaseRowsRequestsBatcher.batchReleases(function (releaseRowsRequests) {
for (var _i10 = 0, _Object$keys = Object.keys(startedRowsRequests.current); _i10 < _Object$keys.length; _i10++) {
var _sectionKey4 = _Object$keys[_i10];
releaseRowsRequests(_sectionKey4);
}
});
}, [releaseRowsRequestsBatcher]);
var getRowData = (0, _react.useCallback)(function (sectionKey, rowKey) {

@@ -875,10 +889,13 @@ var sectionRowData = rowsBySection[sectionKey];

if (lastSectionsRef.current !== sections) {
lastSectionsRef.current = sections;
var currentSectionKeys = Object.keys(startedRowsRequests.current);
(currentSectionKeys || []).forEach(function (sectionKey) {
if (sections.findIndex(function (section) {
return section.key === sectionKey;
}) < 0) {
releaseRowsRequests(sectionKey);
}
lastSectionsRef.current = sections; // detect changes in the passed-in sections object, and then
// update startedRowsRequests in response to that.
releaseRowsRequestsBatcher.batchReleases(function (releaseRowsRequests) {
Object.keys(startedRowsRequests.current).forEach(function (sectionKey) {
if (!sections.find(function (section) {
return section.key === sectionKey;
})) {
releaseRowsRequests(sectionKey);
}
});
});

@@ -893,3 +910,3 @@ }

createRowsRequest: createRowsRequest,
releaseRowsRequests: releaseRowsRequests,
releaseRowsRequestsBatcher: releaseRowsRequestsBatcher,
rowsBySection: rowsBySection,

@@ -896,0 +913,0 @@ getRowData: getRowData

@@ -60,3 +60,3 @@ "use strict";

createRowsRequest = _useRowsBySection.createRowsRequest,
releaseRowsRequests = _useRowsBySection.releaseRowsRequests,
releaseRowsRequestsBatcher = _useRowsBySection.releaseRowsRequestsBatcher,
resetRowsBySection = _useRowsBySection.reset,

@@ -144,11 +144,13 @@ getEffectiveSectionRowCount = _useRowsBySection.getEffectiveSectionRowCount,

if (dropTriggered) {
(0, _findStartedRowsRequestsOutsideRange["default"])(startedRowsRequests, sectionKeysToIndexes, dropLimitRange, function (outsideRequests) {
var sectionKey = outsideRequests.sectionKey,
requestIndexes = outsideRequests.requestIndexes;
releaseRowsRequestsBatcher.batchReleases(function (releaseRowsRequests) {
(0, _findStartedRowsRequestsOutsideRange["default"])(startedRowsRequests, sectionKeysToIndexes, dropLimitRange, function (outsideRequests) {
var sectionKey = outsideRequests.sectionKey,
requestIndexes = outsideRequests.requestIndexes;
if (requestIndexes === 'WHOLE SECTION') {
releaseRowsRequests(sectionKey);
} else {
releaseRowsRequests(sectionKey, requestIndexes);
}
if (requestIndexes === 'WHOLE SECTION') {
releaseRowsRequests(sectionKey);
} else {
releaseRowsRequests(sectionKey, requestIndexes);
}
});
});

@@ -155,0 +157,0 @@ } // Done handling unloads.

{
"name": "streaksheet",
"version": "0.9.6",
"version": "0.9.7",
"author": "Chris Cowan <agentme49@gmail.com>",

@@ -68,3 +68,4 @@ "license": "MIT",

"peerDependencies": {
"react": "^16.13.1 || ^17.0.0"
"react": "^16.13.1 || ^17.0.0",
"react-dom": "^16.13.1 || ^17.0.0"
},

@@ -71,0 +72,0 @@ "husky": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc