mirror of
https://github.com/Readarr/Readarr.git
synced 2026-04-21 22:04:31 -04:00
16 lines
407 B
JavaScript
16 lines
407 B
JavaScript
import { createSelector } from 'reselect';
|
|
import createBookSelector from './createBookSelector';
|
|
|
|
function createBookAuthorSelector() {
|
|
return createSelector(
|
|
createBookSelector(),
|
|
(state) => state.authors.itemMap,
|
|
(state) => state.authors.items,
|
|
(book, authorMap, allAuthors) => {
|
|
return allAuthors[authorMap[book.authorId]];
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createBookAuthorSelector;
|