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
525 B
18 lines
525 B
import { createSelector } from 'reselect';
|
|
import AppState from 'App/State/AppState';
|
|
|
|
function createMetadataProfileSelector() {
|
|
return createSelector(
|
|
(_: AppState, { metadataProfileId }: { metadataProfileId: number }) =>
|
|
metadataProfileId,
|
|
(state: AppState) => state.settings.metadataProfiles.items,
|
|
(metadataProfileId, metadataProfiles) => {
|
|
return metadataProfiles.find(
|
|
(profile) => profile.id === metadataProfileId
|
|
);
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createMetadataProfileSelector;
|