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.
Lidarr/frontend/src/Store/Selectors/createQueueItemSelector.ts

19 lines
474 B

import { createSelector } from 'reselect';
import AppState from 'App/State/AppState';
function createQueueItemSelector() {
return createSelector(
(_: AppState, { albumId }: { albumId: number }) => albumId,
(state: AppState) => state.queue.details.items,
(albumId, details) => {
if (!albumId || !details) {
return null;
}
return details.find((item) => item.albumId === albumId);
}
);
}
export default createQueueItemSelector;