Last active
September 9, 2021 17:49
-
-
Save mirmostafa/acaa21a44c65d568eccdf63eec377f09 to your computer and use it in GitHub Desktop.
How to use async/await in Typescript
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
| ##def: | |
| private getMerchantConfigData() { | |
| return new Promise((resolve, reject) => { | |
| this.configService.get().subscribe(res => { | |
| this.merchantConfigData = res; | |
| resolve(true); | |
| }); | |
| }) | |
| } | |
| ##use: | |
| await this.getMerchantConfigData(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment