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.
14 lines
343 B
14 lines
343 B
5 years ago
|
import { createSelector } from 'reselect';
|
||
|
|
||
5 years ago
|
function createDiscoverMovieSelector() {
|
||
5 years ago
|
return createSelector(
|
||
|
(state, { movieId }) => movieId,
|
||
5 years ago
|
(state) => state.discoverMovie,
|
||
5 years ago
|
(movieId, allMovies) => {
|
||
|
return allMovies.items.find((movie) => movie.tmdbId === movieId);
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
|
||
5 years ago
|
export default createDiscoverMovieSelector;
|