`.promise` by default
See original GitHub issueApologies if there’s a feature request already I wasn’t able to find it, or If I did a poor job at reading the docs and missed something …
It would be real nice to have a setting that can be passed into the constructor that tells the library to use promises by default
So instead of having to do:
resource.methodA({...}).promise()
// ...
resource.methodB({...}).promise()
// and so on and so on for each method being called
one would be able to do something like
const resource = new AWS.FooResource({
region: 'us-east-1',
...
usePromise: true
});
then all methods would be promises by default so a user wouldn’t have to append the .promise
bit to the end of the method.
TY
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Promise - JavaScript - MDN Web Docs
The Promise object represents the eventual completion (or failure) of an asynchronous operation and its resulting value.
Read more >Default Return Value for Resolved Promise - Stack Overflow
I'm learning about writing functions that return promises in ES6, for example: function ...
Read more >Understand the Javascript Promise | by Jamie Uttariello
There are two main properties of the Promise object, state and value. The default 'state' is 'pending', the default 'value' is 'undefined'.
Read more >Return a Default Value with Promises Using catch
Today's JavaScript Promise trick is brought to you by Claudio Semeraro: how to use catch to set a default value instead of a...
Read more >An intriguing reason why Node.js libraries aren't promises by ...
So this one's for you, Ravish! Let's deal with the first question first: “Why doesn't the AWS node sdk just return a promise...
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
Opting to close this issue. This change will not be made on V2 of the SDK.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.