react-infinite-scroller
react-infinite-scroller copied to clipboard
a controlled props 'page' or allow 'loadMore' return a Promise
Is your feature request related to a problem? Please describe.
the loadMore function will be fire multiple times even my previous loadMore has not finish yet
Describe the solution you'd like So I came up with 2 ways to solve this problem
InfiniteScrolllcan receive a new props:pageand passthis.props.page +1toloadMorefunction rather thanthis.pageLoaded += 1, than parent component can deal withpageby itself- allow loadMore function return a Promise object, and loadMore will not be firing again until previous Promise transform to a resolve/reject status
Describe alternatives you've considered
In face, I can set a very small offset, as far as possible, to avoid invoke loadMore in multiple times, but it will damage normal user experience, So, i abandon this idea...
Additional context I think these 2 ways are both easy to implement, If need, I can submit a PR directly