File tree 2 files changed +10
-8
lines changed
2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -57,13 +57,14 @@ yarn install && yarn start
57
57
58
58
## Properties
59
59
60
- Raw component props (before transform):
61
-
62
- | Prop | Type | Description |
63
- | ------------- | ------ | -------------------------- |
64
- | threshold | number | Threshold to call loadMore |
65
- | elementScroll | node | Element to bind scroll |
66
- | loadMore | func | Call with offset |
60
+ Component props:
61
+
62
+ | Prop | Type | Description |
63
+ | ------------- | ------ | ----------------------------------------- |
64
+ | threshold | number | Threshold to call loadMore |
65
+ | elementScroll | node | Element to bind scroll |
66
+ | hasMore | bool | Tells you if there are more items to load |
67
+ | loadMore | func | Call with offset |
67
68
68
69
## NPM Statistics
69
70
Original file line number Diff line number Diff line change 3
3
4
4
export let threshold = 0 ;
5
5
export let elementScroll;
6
+ export let hasMore = true ;
6
7
7
8
const dispatch = createEventDispatcher ();
8
9
let isLoadMore = false ;
22
23
e .target .scrollHeight - e .target .clientHeight - e .target .scrollTop ;
23
24
24
25
if (offset <= threshold) {
25
- if (! isLoadMore) {
26
+ if (! isLoadMore && hasMore ) {
26
27
dispatch (" loadMore" );
27
28
}
28
29
isLoadMore = true ;
You can’t perform that action at this time.
0 commit comments