You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
611 B
23 lines
611 B
7 years ago
|
import { createSelector } from 'reselect';
|
||
11 months ago
|
import AppState from 'App/State/AppState';
|
||
7 years ago
|
import createAllArtistSelector from './createAllArtistSelector';
|
||
|
|
||
|
function createArtistCountSelector() {
|
||
|
return createSelector(
|
||
|
createAllArtistSelector(),
|
||
11 months ago
|
(state: AppState) => state.artist.error,
|
||
|
(state: AppState) => state.artist.isFetching,
|
||
|
(state: AppState) => state.artist.isPopulated,
|
||
4 years ago
|
(artists, error, isFetching, isPopulated) => {
|
||
5 years ago
|
return {
|
||
|
count: artists.length,
|
||
4 years ago
|
error,
|
||
|
isFetching,
|
||
11 months ago
|
isPopulated,
|
||
5 years ago
|
};
|
||
7 years ago
|
}
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default createArtistCountSelector;
|