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
import { createSelector } from 'reselect';
|
|
import AppState from 'App/State/AppState';
|
|
import createAllArtistSelector from './createAllArtistSelector';
|
|
|
|
function createArtistCountSelector() {
|
|
return createSelector(
|
|
createAllArtistSelector(),
|
|
(state: AppState) => state.artist.error,
|
|
(state: AppState) => state.artist.isFetching,
|
|
(state: AppState) => state.artist.isPopulated,
|
|
(artists, error, isFetching, isPopulated) => {
|
|
return {
|
|
count: artists.length,
|
|
error,
|
|
isFetching,
|
|
isPopulated,
|
|
};
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createArtistCountSelector;
|