Skip to content

Instantly share code, notes, and snippets.

@newerton
Created September 15, 2022 18:08
Show Gist options
  • Save newerton/cd708cfb81408d2b7a18b21d4c427bea to your computer and use it in GitHub Desktop.
Save newerton/cd708cfb81408d2b7a18b21d4c427bea to your computer and use it in GitHub Desktop.
Interface segregation principle (ISP)
type Video = {
title: string
duration: number
coverUrl: string
}
type Props = {
items: Array<Video>
}
const VideoList = ({ items }) => {
return (
<ul>
{items.map(item =>
<Thumbnail
key={item.title}
video={item}
/>
)}
</ul>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment