# All files / src/utils fetchImage.js

100% Statements 4/4
100% Branches 0/0
100% Functions 2/2
100% Lines 4/4

    1
    2
    3
    4
    5
    6
    7
    8
    9

    1x
    1x
    1x
    1x

     // @flow

    export default (image: Image, imageSrc: string): any =>
      new Promise((resolve, error) => {
        image.src = imageSrc; // eslint-disable-line no-param-reassign
        image.onload = resolve; // eslint-disable-line no-param-reassign
        image.onerror = error; // eslint-disable-line no-param-reassign
      });