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.
18 lines
517 B
18 lines
517 B
import { some } from 'lodash';
|
|
import { createSelector } from 'reselect';
|
|
import AppState from 'App/State/AppState';
|
|
import createAllArtistSelector from './createAllArtistSelector';
|
|
|
|
function createExistingArtistSelector() {
|
|
return createSelector(
|
|
(_: AppState, { foreignArtistId }: { foreignArtistId: string }) =>
|
|
foreignArtistId,
|
|
createAllArtistSelector(),
|
|
(foreignArtistId, artist) => {
|
|
return some(artist, { foreignArtistId });
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createExistingArtistSelector;
|