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.
19 lines
474 B
19 lines
474 B
import { createSelector } from 'reselect';
|
|
import AppState from 'App/State/AppState';
|
|
|
|
function createQueueItemSelector() {
|
|
return createSelector(
|
|
(_: AppState, { movieId }: { movieId: number }) => movieId,
|
|
(state: AppState) => state.queue.details.items,
|
|
(movieId, details) => {
|
|
if (!movieId || !details) {
|
|
return null;
|
|
}
|
|
|
|
return details.find((item) => item.movieId === movieId);
|
|
}
|
|
);
|
|
}
|
|
|
|
export default createQueueItemSelector;
|