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.
15 lines
426 B
15 lines
426 B
3 months ago
|
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;
|