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.
Readarr/frontend/src/Store/Selectors/createMultiAuthorsSelector.ts

15 lines
426 B

import { createSelector } from 'reselect';
import AppState from 'App/State/AppState';
function createMultiAuthorsSelector(authorIds: number[]) {
return createSelector(
(state: AppState) => state.authors.itemMap,
(state: AppState) => state.authors.items,
(itemMap, allAuthors) => {
return authorIds.map((authorId) => allAuthors[itemMap[authorId]]);
}
);
}
export default createMultiAuthorsSelector;