Created
September 26, 2017 11:08
-
-
Save andreasvirkus/e3b2b849ed25fa7c04c0caa3fe14498d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wait from './wait'; | |
//... | |
save(formData) { | |
//... | |
upload(formData) | |
.then(wait(1500)) // DEV ONLY: wait for 1.5s | |
.then(x => { | |
this.uploadedFiles = [].concat(x); | |
this.currentStatus = STATUS_SUCCESS; | |
}) | |
//... | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default function wait(ms) { | |
return (x) => { | |
return new Promise(resolve => setTimeout(() => resolve(x), ms)); | |
}; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment