refactor promise and promise.all with async await of es2017
问题 I have a working version of a photo upload handler but I would want to see how it work with async await. Before anything below is my working code using promise. onChangePhotos = (e) => { e.preventDefault() let files = e.target.files if(files.length === 0) { return } const allow_photos_length = this.state.selectedAlbum.photos.length + files.length if(allow_photos_length > this.state.maxPhoto) { alert(`Maximum only ${maxPhoto} photos per album!`) return } this.setState({ uploading_photo: true }