Skip to content

Instantly share code, notes, and snippets.

@SuperOleg39
Created March 6, 2019 22:26
Show Gist options
  • Select an option

  • Save SuperOleg39/9502300d35e4dbfcdf852a6419e0e844 to your computer and use it in GitHub Desktop.

Select an option

Save SuperOleg39/9502300d35e4dbfcdf852a6419e0e844 to your computer and use it in GitHub Desktop.
// entities/video/index.ts
type IVideo = {
src: string;
}
const getVideoSrc = (video: IVideo): number => {
return video.src;
}
const setVideoSrc = (video: IVideo, src: string): number => {
return { ... video, src };
}
// redux/entities/index.ts
type IEntitiesState = {
videos: IVideosState;
}
// redux/entities/video/index.ts
type IVideosState = {
[key: number]: IVideo;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment