Skip to content

Instantly share code, notes, and snippets.

@aganglada
Created September 21, 2017 19:24
Show Gist options
  • Select an option

  • Save aganglada/812781ba6ff0601022eb79eb4db6eb3c to your computer and use it in GitHub Desktop.

Select an option

Save aganglada/812781ba6ff0601022eb79eb4db6eb3c to your computer and use it in GitHub Desktop.

Revisions

  1. aganglada created this gist Sep 21, 2017.
    4 changes: 4 additions & 0 deletions create-image.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,4 @@
    const img = new Image()
    img.src = this.props.src
    img.onload = this.onLoadImage
    img.onerror = this.onLoadImageError