Skip to content

Commit

Permalink
fix: useInfiniteScroll ts error (#1575)
Browse files Browse the repository at this point in the history
  • Loading branch information
brickspert authored Apr 27, 2022
1 parent 63b80e3 commit b5b95dd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/hooks/src/useInfiniteScroll/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,13 @@ const useInfiniteScroll = <TData extends Data>(
);

const loadMore = () => {
if (noMore) return;
// if (noMore) return;
setLoadingMore(true);
run(finalData);
};

const loadMoreAsync = () => {
if (noMore) return;
// if (noMore) return;
setLoadingMore(true);
return runAsync(finalData);
};
Expand Down
2 changes: 1 addition & 1 deletion packages/hooks/src/useInfiniteScroll/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { BasicTarget } from '../utils/domTarget';

export type Data = { list: any[]; [key: string]: any };

export type Service<TData extends Data> = (currentData?: TData) => Promise<TData>;
export type Service<TData extends Data> = (currentData?: Data) => Promise<TData>;

export interface InfiniteScrollResult<TData extends Data> {
data: TData;
Expand Down

0 comments on commit b5b95dd

Please sign in to comment.