Skip to content

Instantly share code, notes, and snippets.

@sheeley
Created August 15, 2017 20:08
Show Gist options
  • Save sheeley/88dab4691227e1accdadcada94e1af9a to your computer and use it in GitHub Desktop.
Save sheeley/88dab4691227e1accdadcada94e1af9a to your computer and use it in GitHub Desktop.
Example
// Base implementation:
function videoExperience(options) {
var elem = document.createElement("...")
// attach handlers, set up video/images/etc
return elem
}
// TCS:
var video = videoExperience(options)
document.getElementById("videoContainer").appendChild(video)
// React:
class VideoWrapper extends React.Component {
render() {
const video = videoExperience(props)
return (video)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment