question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`.promise` by default

See original GitHub issue

Apologies 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:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
srchasecommented, Jan 21, 2019

Opting to close this issue. This change will not be made on V2 of the SDK.

0reactions
lock[bot]commented, Sep 28, 2019

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found