Created
October 17, 2018 16:03
-
-
Save josephdburdick/4b0142eceb8406f801925a65a8bf91fb to your computer and use it in GitHub Desktop.
$ = querySelector
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
// 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