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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(aggregate): add Aggregate.prototype.finally() to be consistent with Promise API for TypeScript #13509

Merged
merged 1 commit into from
Jun 14, 2023

Conversation

vkarpov15
Copy link
Collaborator

Summary

Ran into this issue earlier: using Model.aggregate() in a place where a promise is expected, like assert.rejects(), TypeScript reports an error because Aggregate doesn't have finally() or [toStringTag].

Argument of type 'Aggregate<any[]>' is not assignable to parameter of type 'Promise<unknown> | (() => Promise<unknown>)'.
      Type 'Aggregate<any[]>' is missing the following properties from type 'Promise<unknown>': finally, [Symbol.toStringTag]

We already have [toStringTag] and finally() on Query, so would be nice to have them on Aggregate as well.

Examples

@vkarpov15 vkarpov15 added this to the 7.3.0 milestone Jun 14, 2023
Copy link
Collaborator

@IslandRhythms IslandRhythms left a comment

Choose a reason for hiding this comment

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

LGTM

@vkarpov15 vkarpov15 merged commit b6f18fe into 7.3 Jun 14, 2023
@vkarpov15 vkarpov15 deleted the vkarpov15/aggregate-finally branch June 14, 2023 18:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants