Created
February 11, 2019 10:07
-
-
Save mohnatus/3e43bce8a552cf29f63cea5d39099301 to your computer and use it in GitHub Desktop.
general promise constructor
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
| let promise = new Promise((resolve, reject) => { | |
| setTimeout(() => { | |
| resolve('new value'); | |
| }, 1000) | |
| }); | |
| promise | |
| .then( | |
| data => console.log(data), | |
| error => console.log(error) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment