Skip to content

Instantly share code, notes, and snippets.



Last active Mar 17, 2016
What would you like to do?
async function chooseFile(){
const ev = await F.on('#chooser', 'change');
const files =, 0);
const imageFiles = files.filter((f)=>f.type.match('image.*'));
if(imageFiles.length !== 0) {
const imagePromises =;
const images = (await Promise.all(imagePromises)).map((i)=>;
const names =>;
const imageData =, names).map(([data,name])=> {
return {data, name}
return actions.appendImage(imageData);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment