Skip to content

Instantly share code, notes, and snippets.

Last active November 20, 2017 17:24
What would you like to do?
Pre-load images for faster painting of new images
// example imgObj
const img = {
filename: 'example.jpg',
caption: 'example-caption'
function preloadImgs (imageLs) {
imageLs.forEach(imgObj => {
let img = new Image()
img.src = imgObj.filename
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment