Created
August 4, 2020 14:46
-
-
Save nlopin/582d79374db2e29797d787f3f9788188 to your computer and use it in GitHub Desktop.
Promise
This file contains 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(function(resolve, reject) { | |
const data = ... // асинхронная операция: запрос в БД, API, etc. | |
resolve(data); // переводим промис в состояние fulfilled и отдаем наружу результат операции | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment