Lazy loading cleanup
This commit is contained in:
@ -97,7 +97,11 @@ class DiscoverCategory extends React.Component{
|
||||
<section className="grid-wrapper">
|
||||
<PlaylistGrid playlists={playlists} />
|
||||
</section>
|
||||
<LazyLoadListener loading={this.props.category.playlists_more} loadMore={ () => this.loadMore() }/>
|
||||
<LazyLoadListener
|
||||
loadKey={this.props.category.playlists_more}
|
||||
showLoader={this.props.category.playlists_more}
|
||||
loadMore={() => this.loadMore()}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
@ -32,6 +32,11 @@ class DiscoverNewReleases extends React.Component{
|
||||
}
|
||||
|
||||
loadMore(){
|
||||
|
||||
// TODO: Figure out how to check for duplicated requests
|
||||
// perhaps we catch this at Spotify actions, by checking for
|
||||
// pending requests on the same URL, and invalidate the Promise?
|
||||
|
||||
this.props.spotifyActions.getMore(
|
||||
this.props.new_releases_more,
|
||||
null,
|
||||
@ -138,7 +143,11 @@ class DiscoverNewReleases extends React.Component{
|
||||
<section className="content-wrapper grid-wrapper">
|
||||
<AlbumGrid albums={albums} />
|
||||
</section>
|
||||
<LazyLoadListener loading={this.props.new_releases_more} loadMore={ () => this.loadMore() }/>
|
||||
<LazyLoadListener
|
||||
loadKey={this.props.new_releases_more}
|
||||
showLoader={this.props.new_releases_more}
|
||||
loadMore={() => this.loadMore()}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user