mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-01-25 01:55:07 +00:00
18 lines
393 B
JavaScript
18 lines
393 B
JavaScript
import { createSelector } from 'reselect';
|
|
|
|
function createBookFileSelector() {
|
|
return createSelector(
|
|
(state, { bookFileId }) => bookFileId,
|
|
(state) => state.bookFiles,
|
|
(bookFileId, bookFiles) => {
|
|
if (!bookFileId) {
|
|
return;
|
|
}
|
|
|
|
return bookFiles.items.find((bookFile) => bookFile.id === bookFileId);
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createBookFileSelector;
|