Socket
Socket
Sign inDemoInstall

react-cool-virtual

Package Overview
Dependencies
5
Maintainers
1
Versions
56
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.4 to 0.4.5

2

package.json
{
"name": "react-cool-virtual",
"version": "0.4.4",
"version": "0.4.5",
"description": "A tiny React hook for rendering large datasets like a breeze.",

@@ -5,0 +5,0 @@ "license": "MIT",

@@ -1034,13 +1034,13 @@ <p align="center">

```js
const props = useVirtual({
onScroll: ({
startIndex, // (number) The index of the first batch item
stopIndex, // (number) The index of the last batch item
loadIndex, // (number) The index of the current batch items (e.g. 1 - 15 as `0`, 16 - 30 as `1`, and so on)
scrollOffset, // (number) The scroll offset from top/left, depending on the `horizontal` option
userScroll, // (boolean) Tells you the scrolling is through the user or not
}) => {
// Fetch data...
},
});
const loadMore = ({
startIndex, // (number) The index of the first batch item
stopIndex, // (number) The index of the last batch item
loadIndex, // (number) The index of the current batch items (e.g. 1 - 15 as `0`, 16 - 30 as `1`, and so on)
scrollOffset, // (number) The scroll offset from top/left, depending on the `horizontal` option
userScroll, // (boolean) Tells you the scrolling is through the user or not
}) => {
// Fetch data...
};
const props = useVirtual({ loadMore });
```

@@ -1055,15 +1055,15 @@

```js
const props = useVirtual({
onScroll: ({
overscanStartIndex, // (number) The index of the first overscan item
overscanStopIndex, // (number) The index of the last overscan item
visibleStartIndex, // (number) The index of the first visible item
visibleStopIndex, // (number) The index of the last visible item
scrollOffset, // (number) The scroll offset from top/left, depending on the `horizontal` option
scrollForward, // (boolean) The scroll direction of up/down or left/right, depending on the `horizontal` option
userScroll, // (boolean) Tells you the scrolling is through the user or not
}) => {
// Do something...
},
});
const onScroll = ({
overscanStartIndex, // (number) The index of the first overscan item
overscanStopIndex, // (number) The index of the last overscan item
visibleStartIndex, // (number) The index of the first visible item
visibleStopIndex, // (number) The index of the last visible item
scrollOffset, // (number) The scroll offset from top/left, depending on the `horizontal` option
scrollForward, // (boolean) The scroll direction of up/down or left/right, depending on the `horizontal` option
userScroll, // (boolean) Tells you the scrolling is through the user or not
}) => {
// Do something...
};
const props = useVirtual({ onScroll });
```

@@ -1078,10 +1078,10 @@

```js
const props = useVirtual({
onResize: ({
width, // (number) The content width of the outer element
height, // (number) The content height of the outer element
}) => {
// Do something...
},
});
const onResize = ({
width, // (number) The content width of the outer element
height, // (number) The content height of the outer element
}) => {
// Do something...
};
const props = useVirtual({ onResize });
```

@@ -1088,0 +1088,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc