1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2026-04-22 22:16:13 -04:00

Convert store selectors to Typescript

This commit is contained in:
Bogdan
2023-07-30 16:23:41 +03:00
committed by Mark McDowall
parent 94c6b0fde3
commit a57b35a196
35 changed files with 250 additions and 173 deletions
@@ -0,0 +1,18 @@
import { createSelector } from 'reselect';
import AppState from 'App/State/AppState';
function createQueueItemSelector() {
return createSelector(
(_: AppState, { episodeId }: { episodeId: number }) => episodeId,
(state: AppState) => state.queue.details.items,
(episodeId, details) => {
if (!episodeId || !details) {
return null;
}
return details.find((item) => item.episodeId === episodeId);
}
);
}
export default createQueueItemSelector;