Sha256: 53c57fc6c7b009d93908dfe9aa7cb7d6e0730d8d4dd4df8bd52004895e322805
Contents?: true
Size: 361 Bytes
Versions: 6
Compression:
Stored size: 361 Bytes
Contents
import moment from 'moment' export function encodeImageFileAsURL(element) { return new Promise((resolve, reject) => { var file = element.files[0]; var reader = new FileReader(); reader.fileName = file.name reader.onloadend = function() { resolve({src: reader.result, name: reader.fileName}) } reader.readAsDataURL(file); }) }
Version data entries
6 entries across 6 versions & 1 rubygems