Skip to content

Instantly share code, notes, and snippets.

@josephdburdick
Created October 17, 2018 16:03
Show Gist options
  • Save josephdburdick/4b0142eceb8406f801925a65a8bf91fb to your computer and use it in GitHub Desktop.
Save josephdburdick/4b0142eceb8406f801925a65a8bf91fb to your computer and use it in GitHub Desktop.
$ = querySelector
// lightweight version of jQuery to select DOM elements
let $ = document.querySelector.bind(document)
let $$ = document.querySelectorAll.bind(document)
// render products into the products container - we have to call this whenever the state changes
$('.products').innerHTML = products.map(getProductHTML).join(' ')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment