Skip to content

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Dec 5, 2019

Remove usage of PromiseOrVoid, it makes it difficult to consume the API via await. For each async method, define multiple variants to correctly describe what's returned when a callback arg was provided (void) and what's returned when called with no callback (Promise<T>).

See loopbackio/loopback-next#4235 for background information.

Checklist

👉 Read and sign the CLA (Contributor License Agreement) 👈

  • npm test passes on your machine
  • New tests added or existing tests modified to cover all changes
  • Code conforms with the style guide
  • Commit messages are following our guidelines

Copy link
Contributor

@hacksparrow hacksparrow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Contributor

@emonddr emonddr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only commit message needs fixing.

@bajtos bajtos force-pushed the fix/datasource-typings branch from 6210905 to b80d604 Compare December 5, 2019 14:57
Copy link
Contributor

@raymondfeng raymondfeng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Remove usage of `PromiseOrVoid`, it makes it difficult to consume
the API via `await`. For each async method, define multiple variants
to correctly describe what's returned when a callback arg was provided
(`void`) and what's returned when called with no callback
(`Promise<T>`).

Signed-off-by: Miroslav Bajtoš <mbajtoss@gmail.com>
@bajtos bajtos force-pushed the fix/datasource-typings branch from b80d604 to 19048cd Compare December 5, 2019 15:30
Copy link
Contributor

@jannyHou jannyHou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@bajtos bajtos merged commit c555ded into master Dec 5, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix/datasource-typings branch December 5, 2019 16:04
@bajtos bajtos mentioned this pull request Dec 6, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants