react-infinite-scroll-hook
Advanced tools
Comparing version
@@ -13,3 +13,3 @@ import { IntersectionObserverHookRefCallback, IntersectionObserverHookRootRefCallback, IntersectionObserverHookArgs } from 'react-intersection-observer-hook'; | ||
hasNextPage: boolean; | ||
onLoadMore: VoidFunction; | ||
onLoadMore: () => unknown; | ||
disabled?: boolean; | ||
@@ -16,0 +16,0 @@ delayInMs?: number; |
@@ -1,1 +0,1 @@ | ||
"use strict";var n=Object.defineProperty;var b=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var U=(o,e)=>{for(var t in e)n(o,t,{get:e[t],enumerable:!0})},u=(o,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of H(e))!S.call(o,l)&&l!==t&&n(o,l,{get:()=>e[l],enumerable:!(i=b(e,l))||i.enumerable});return o};var y=o=>u(n({},"__esModule",{value:!0}),o);var d={};U(d,{default:()=>g});module.exports=y(d);var c=require("react"),f=require("react-intersection-observer-hook"),C=100;function m({loading:o,hasNextPage:e,onLoadMore:t,rootMargin:i,disabled:l,delayInMs:r=C}){let[k,{rootRef:I,isVisible:p}]=(0,f.useTrackVisibility)({rootMargin:i}),s=!l&&!o&&p&&e;return(0,c.useEffect)(()=>{if(s){let R=setTimeout(()=>{t()},r);return()=>{clearTimeout(R)}}},[t,s,r]),[k,{rootRef:I}]}var a=m;var g=a; | ||
"use strict";var i=Object.defineProperty;var p=Object.getOwnPropertyDescriptor;var H=Object.getOwnPropertyNames;var S=Object.prototype.hasOwnProperty;var U=(o,e)=>{for(var t in e)i(o,t,{get:e[t],enumerable:!0})},y=(o,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let l of H(e))!S.call(o,l)&&l!==t&&i(o,l,{get:()=>e[l],enumerable:!(n=p(e,l))||n.enumerable});return o};var C=o=>y(i({},"__esModule",{value:!0}),o);var d={};U(d,{default:()=>k});module.exports=C(d);var r=require("react"),a=require("react-intersection-observer-hook"),m=100;function g({loading:o,hasNextPage:e,onLoadMore:t,rootMargin:n,disabled:l,delayInMs:s=m}){let c=(0,r.useRef)(t),[b,{rootRef:R,isVisible:I}]=(0,a.useTrackVisibility)({rootMargin:n});(0,r.useEffect)(()=>{c.current=t},[t]);let f=!l&&!o&&I&&e;return(0,r.useEffect)(()=>{if(f){let u=setTimeout(()=>{c.current()},s);return()=>{clearTimeout(u)}}},[f,s]),[b,{rootRef:R}]}var k=g; |
{ | ||
"name": "react-infinite-scroll-hook", | ||
"version": "5.0.0-alpha.0", | ||
"version": "5.0.0", | ||
"description": "A simple hook to create infinite scroll components", | ||
@@ -17,3 +17,3 @@ "keywords": [ | ||
"type": "git", | ||
"url": "https://github.com/onderonur/react-infinite-scroll-hook.git" | ||
"url": "git+https://github.com/onderonur/react-infinite-scroll-hook.git" | ||
}, | ||
@@ -41,19 +41,25 @@ "license": "MIT", | ||
"scripts": { | ||
"attw:check": "attw --pack .", | ||
"build": "tsup", | ||
"dev": "tsup --watch", | ||
"lint": "eslint src --max-warnings 0", | ||
"lint:fix": "eslint src --fix --max-warnings 0", | ||
"lint:check": "eslint . --max-warnings 0", | ||
"lint:fix": "eslint . --fix --max-warnings 0", | ||
"prepublishOnly": "npm run build", | ||
"typecheck": "tsc" | ||
"publint:check": "publint", | ||
"types:check": "tsc" | ||
}, | ||
"dependencies": { | ||
"react-intersection-observer-hook": "^3.0.0-alpha.0" | ||
"react-intersection-observer-hook": "^3.0.0" | ||
}, | ||
"devDependencies": { | ||
"@arethetypeswrong/cli": "^0.15.4", | ||
"@repo/eslint-config": "*", | ||
"@repo/lint-staged-config": "*", | ||
"@repo/typescript-config": "*", | ||
"@types/react": "^18.2.74", | ||
"react": "^18.2.0", | ||
"tsup": "^8.0.2", | ||
"typescript": "^5.4.4" | ||
"@types/react": "^18.3.3", | ||
"eslint": "^8.57.0", | ||
"publint": "^0.2.10", | ||
"react": "^18.3.1", | ||
"tsup": "^8.2.4", | ||
"typescript": "^5.5.4" | ||
}, | ||
@@ -60,0 +66,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
14823
210.69%7
40%1
-50%0
-100%156
Infinity%0
-100%10
66.67%