const getFile = async ( item , path ) => new Promise ( resolve => { item . file ( ( file ) => { const reader = new FileReader ( ) ; reader . onload = ( e ) => { return resolve ( { file , src : e . target . result , path : path . split ( '/' ) . join ( '' ) , } ) ; } ; reader . readAsDataURL ( file ) ; } ) ; } ) ; export default getFile ;