Promise seems to be not working
See original GitHub issueHello,
It seems the async/await
pattern is not working.
const { request_id: requestId, status, error_text: errorText } = await nexmo.verify.request({
number: `639151112233`,
brand,
code_length: 6,
format: 'json',
});
Only the callback pattern is working. Is this a bug or just not supported? Thanks a lot.
Issue Analytics
- State:
- Created 5 years ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Why "this" seems not working to resolve a promise on load event
Having the following javascript Promise code: const loadImage = (src) => new Promise((resolve, reject) => ...
Read more >The Problem with Promises in JavaScript - DEV Community
Promises lack a convenient API to safely work with data. This second case is a problem only because the promise API doesn't offer...
Read more >God's Promise to Hagar: Clearing up a misunderstanding
But this is not all God does. He promises her a multitude of descendants. It appears that God is coming alongside Hagar to...
Read more >How to use promises - Learn web development | MDN
A promise is an object returned by an asynchronous function, which represents the ... "promise" is a Promise object, so this will not...
Read more >broken promise collocation | meanings and examples of use
Examples of broken promise in a sentence, how to use it. 20 examples: Is it yet another broken promise to add to a...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In the meantime you could always wrap the API using promisify (requires Node 8+) https://nodejs.org/dist/latest-v8.x/docs/api/util.html
Here’s an example using the sendSms API
Using Promise as default is quite a must have to avoid some hacks like https://github.com/Nexmo/nexmo-node/issues/197#issuecomment-409252927 (thanks @arvi BTW!).
Could we re-open the issue until this got implemented?