-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
41 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,65 +1,66 @@ | ||
import {createSelector} from 'reselect'; | ||
|
||
import {changeVideoUrl} from '../utils'; | ||
import {Film, User, Review} from '../types'; | ||
|
||
export const getFilms = (state) => { | ||
export const getFilms = (state): Film[] => { | ||
return state.films; | ||
}; | ||
|
||
export const getFilmsWithChangedUrl = createSelector( | ||
getFilms, | ||
(films) => { | ||
return changeVideoUrl(films); | ||
} | ||
getFilms, | ||
(films) => { | ||
return changeVideoUrl(films); | ||
} | ||
); | ||
|
||
export const getFavorites = (state) => { | ||
export const getFavorites = (state): Film[] => { | ||
return state.favorites; | ||
}; | ||
|
||
export const getFavoritesWithChangedUrl = createSelector( | ||
getFavorites, | ||
(films) => { | ||
return changeVideoUrl(films); | ||
} | ||
getFavorites, | ||
(films) => { | ||
return changeVideoUrl(films); | ||
} | ||
); | ||
|
||
export const getGenre = (state) => { | ||
export const getGenre = (state): string => { | ||
return state.genre; | ||
}; | ||
|
||
export const getpromo = (state) => { | ||
export const getpromo = (state): Film => { | ||
return state.promo; | ||
}; | ||
|
||
export const getFilmsCounter = (state) => { | ||
export const getFilmsCounter = (state): number => { | ||
return state.filmsCounter; | ||
}; | ||
|
||
export const getPlayingFilm = (state) => { | ||
export const getPlayingFilm = (state): Film => { | ||
return state.playingFilm; | ||
}; | ||
|
||
export const getIsAuthorizationRequired = (state) => { | ||
export const getIsAuthorizationRequired = (state): boolean => { | ||
return state.isAuthorizationRequired; | ||
}; | ||
|
||
export const getUser = (state) => { | ||
export const getUser = (state): User => { | ||
return state.user; | ||
}; | ||
|
||
export const getError = (state) => { | ||
export const getError = (state): string => { | ||
return state.error; | ||
}; | ||
|
||
export const getIsReviewSending = (state) => { | ||
export const getIsReviewSending = (state): boolean => { | ||
return state.isReviewSending; | ||
}; | ||
|
||
export const getDidReviewSend = (state) => { | ||
export const getDidReviewSend = (state): boolean => { | ||
return state.didReviewSend; | ||
}; | ||
|
||
export const getReviews = (state) => { | ||
export const getReviews = (state): Review[] => { | ||
return state.comments; | ||
}; |