Skip to content

Instantly share code, notes, and snippets.

@Splode
Last active Nov 20, 2017
Embed
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