Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Promise/Callback variants in datasource types #1807

Merged
merged 1 commit into from Dec 5, 2019
Merged

Conversation

@bajtos
Copy link
Member

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 strongloop/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
@bajtos bajtos requested review from raymondfeng and strongloop/sq-lb-apex Dec 5, 2019
@bajtos bajtos self-assigned this Dec 5, 2019
@bajtos bajtos mentioned this pull request Dec 5, 2019
2 of 2 tasks complete
Copy link
Member

hacksparrow left a comment

馃憤

@emonddr
emonddr approved these changes Dec 5, 2019
Copy link
Contributor

emonddr left a comment

Only commit message needs fixing.

types/datasource.d.ts Show resolved Hide resolved
@bajtos bajtos force-pushed the fix/datasource-typings branch from 6210905 to b80d604 Dec 5, 2019
Copy link
Member

raymondfeng left a comment

馃挴

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 Dec 5, 2019
Copy link
Contributor

jannyHou left a comment

馃殺

@bajtos bajtos merged commit c555ded into master Dec 5, 2019
23 checks passed
23 checks passed
Commit Linter commits are all properly formatted
Details
PR Linter PR is up to date
Details
[cis-jenkins] PR Builder Build finished.
Details
[cis-jenkins] downstream: loopback-connector-cloudant@master Success! (19048cd)
Details
[cis-jenkins] downstream: loopback-connector-grpc@master Success! (19048cd)
Details
[cis-jenkins] downstream: loopback-connector-kv-redis@master Success! (19048cd)
Details
[cis-jenkins] downstream: loopback-connector-mongodb@master Success! (19048cd)
Details
[cis-jenkins] downstream: loopback-connector-mssql@master Success! (19048cd)
Details
[cis-jenkins] downstream: loopback-connector-mysql@master Success! (19048cd)
Details
[cis-jenkins] downstream: loopback-connector-oracle@master Success! (19048cd)
Details
[cis-jenkins] downstream: loopback-connector-postgresql@master Success! (19048cd)
Details
[cis-jenkins] x64 && linux && nvm,10 Success! (19048cd)
Details
[cis-jenkins] x64 && linux && nvm,12 Success! (19048cd)
Details
[cis-jenkins] x64 && linux && nvm,8 Success! (19048cd)
Details
clahub All contributors have signed the Contributor License Agreement.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
coverage/coveralls Coverage remained the same at 84.709%
Details
loopback-datasource-juggler Success! (19048cd)
Details
loopback-datasource-juggler/node=4.x,os=windows Success! (19048cd)
Details
loopback-datasource-juggler/node=6.x,os=windows Success! (19048cd)
Details
pr-builder
Details
security/snyk - package.json (StrongLoop) No manifest changes detected
@delete-merged-branch delete-merged-branch bot deleted the fix/datasource-typings branch Dec 5, 2019
@bajtos bajtos mentioned this pull request Dec 6, 2019
3 of 3 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.