Skip to content

Commit

Permalink
exported ref typings for better typings
Browse files Browse the repository at this point in the history
  • Loading branch information
onderonur committed Jan 28, 2022
1 parent b03c85e commit f961651
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "4.0.0",
"version": "4.0.2",
"license": "MIT",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
Expand Down
9 changes: 8 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
import useInfiniteScroll, {
UseInfiniteScrollHookArgs,
UseInfiniteScrollHookResult,
UseInfiniteScrollHookRefCallback,
UseInfiniteScrollHookRootRefCallback,
} from './useInfiniteScroll';

export { UseInfiniteScrollHookArgs, UseInfiniteScrollHookResult };
export {
UseInfiniteScrollHookArgs,
UseInfiniteScrollHookResult,
UseInfiniteScrollHookRefCallback,
UseInfiniteScrollHookRootRefCallback,
};

export default useInfiniteScroll;
13 changes: 9 additions & 4 deletions src/useInfiniteScroll.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@ import { useEffect } from 'react';
import {
useTrackVisibility,
IntersectionObserverHookArgs,
IntersectionObserverHookRefCallback,
IntersectionObserverHookRootRefCallback,
IntersectionObserverHookRefCallback as UseInfiniteScrollHookRefCallback,
IntersectionObserverHookRootRefCallback as UseInfiniteScrollHookRootRefCallback,
} from 'react-intersection-observer-hook';

const DEFAULT_DELAY_IN_MS = 100;

export {
UseInfiniteScrollHookRefCallback,
UseInfiniteScrollHookRootRefCallback,
};

export type UseInfiniteScrollHookResult = [
IntersectionObserverHookRefCallback,
{ rootRef: IntersectionObserverHookRootRefCallback },
UseInfiniteScrollHookRefCallback,
{ rootRef: UseInfiniteScrollHookRootRefCallback },
];

export type UseInfiniteScrollHookArgs = Pick<
Expand Down

0 comments on commit f961651

Please sign in to comment.