New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

react-bottom-scroll-listener

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-bottom-scroll-listener - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0-beta0

dist/index.es.js

3

dist/hook/index.d.ts

@@ -12,5 +12,6 @@ /// <reference types="lodash" />

* @param debounceOptions Options passed to lodash.debounce, see https://lodash.com/docs/4.17.15#debounce
* @param triggerOnNoScroll Triggers the onBottom callback when the page has no scrollbar
* @return React.MutableRefObject Optionally you can use this to pass to a element to use that as the scroll container
*/
declare function useBottomScrollListener<T extends HTMLElement>(onBottom: () => void, offset?: number, debounce?: number, debounceOptions?: DebounceOptions): import("react").RefObject<T>;
declare function useBottomScrollListener<T extends HTMLElement>(onBottom: () => void, offset?: number, debounce?: number, debounceOptions?: DebounceOptions, triggerOnNoScroll?: boolean): import("react").RefObject<T>;
export default useBottomScrollListener;

@@ -14,3 +14,3 @@ function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }

function useBottomScrollListener(onBottom, offset, debounce, debounceOptions) {
function useBottomScrollListener(onBottom, offset, debounce, debounceOptions, triggerOnNoScroll) {
if (offset === void 0) {

@@ -30,2 +30,6 @@ offset = 0;

if (triggerOnNoScroll === void 0) {
triggerOnNoScroll = false;
}
var debouncedOnBottom = react.useMemo(function () {

@@ -65,2 +69,6 @@ return createCallback(debounce, onBottom, debounceOptions);

if (triggerOnNoScroll) {
handleOnScroll();
}
return function () {

@@ -67,0 +75,0 @@ if (ref != null) {

@@ -12,3 +12,3 @@ import { useMemo, useRef, useCallback, useEffect } from 'react';

function useBottomScrollListener(onBottom, offset, debounce, debounceOptions) {
function useBottomScrollListener(onBottom, offset, debounce, debounceOptions, triggerOnNoScroll) {
if (offset === void 0) {

@@ -28,2 +28,6 @@ offset = 0;

if (triggerOnNoScroll === void 0) {
triggerOnNoScroll = false;
}
var debouncedOnBottom = useMemo(function () {

@@ -63,2 +67,6 @@ return createCallback(debounce, onBottom, debounceOptions);

if (triggerOnNoScroll) {
handleOnScroll();
}
return function () {

@@ -65,0 +73,0 @@ if (ref != null) {

{
"name": "react-bottom-scroll-listener",
"version": "4.0.0",
"version": "4.1.0-beta0",
"description": "A simple React component that lets you listen for when you have scrolled to the bottom.",

@@ -5,0 +5,0 @@ "repository": "https://github.com/karl-run/react-bottom-scroll-listener",

@@ -48,3 +48,3 @@ # react-bottom-scroll-listener ![npm](https://img.shields.io/npm/dm/react-bottom-scroll-listener.svg) [![NPM version](https://img.shields.io/npm/v/react-bottom-scroll-listener.svg?style=flat)](https://www.npmjs.com/package/react-bottom-scroll-listener) [![npm bundle size (minified)](https://img.shields.io/bundlephobia/minzip/react-bottom-scroll-listener.svg)](https://github.com/karl-run/react-bottom-scroll-listener)

const containerRef = useBottomScrollListener(callback);
const scrollRef = useBottomScrollListener(callback);

@@ -51,0 +51,0 @@ <div ref={scrollRef}>Callback will be invoked when this container is scrolled to bottom.</div>

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