Lazy loading keys; Spotify new releases in Spotify reducer, handling duplicates bug

This commit is contained in:
James Barnsley
2018-09-03 14:22:27 +12:00
parent 3344cf5db4
commit 93be7e096b
11 changed files with 14015 additions and 10771 deletions

View File

@ -106,12 +106,14 @@ const SpotifyMiddleware = (function(){
type: 'ALBUMS_LOADED',
albums: action.data.albums.items
});
store.dispatch({
type: 'NEW_RELEASES_LOADED',
uris: helpers.arrayOf('uri',action.data.albums.items),
more: action.data.albums.next,
total: action.data.albums.total
});
// Collate result into the three key values we want
action.uris = helpers.arrayOf('uri', action.data.albums.items);
action.more = action.data.albums.next;
action.total = action.data.albums.total;
// And pass on to our reducer
next(action);
break
case 'SPOTIFY_ARTIST_ALBUMS_LOADED':