Prowlarr/frontend/src/Store/Selectors/createIndexerAppProfileSelector.ts
2023-07-29 03:14:47 +03:00

17 lines
556 B
TypeScript

import { createSelector } from 'reselect';
import AppState from 'App/State/AppState';
import { createIndexerSelectorForHook } from './createIndexerSelector';
function createIndexerAppProfileSelector(indexerId: number) {
return createSelector(
(state: AppState) => state.settings.appProfiles.items,
createIndexerSelectorForHook(indexerId),
(appProfiles, indexer = {}) => {
return appProfiles.find((profile) => {
return profile.id === indexer.appProfileId;
});
}
);
}
export default createIndexerAppProfileSelector;