Last active
November 10, 2017 13:23
-
-
Save gskachkov/1c1fef656b0d2e246b1e5701e934a0e3 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
const promise = new Promise(resolve => { | |
setTimeout(()=>resolve('success')); | |
}); | |
const startOperation = () => { console.log('start'); }; | |
const finishOperation = () => { console.log('finish'); }; | |
startOperation(); | |
promise | |
.then( | |
result => { console.log('success:', result);}, | |
error => { console.log('error:', error);} | |
) | |
.finally(finishOperation); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment