Skip to content
This repository was archived by the owner on Jun 9, 2025. It is now read-only.

Conversation

@lemusthelroy
Copy link

@lemusthelroy lemusthelroy commented Mar 13, 2025

Which problem is this pull request solving?

Adds a type definition for waitUntil

Checklist

Please add a x inside each checkbox:

  • I have read the contribution guidelines.
  • The status checks are successful (continuous integration). Those can be seen below.

@lemusthelroy lemusthelroy marked this pull request as ready for review March 19, 2025 10:49
@lemusthelroy lemusthelroy requested a review from a team as a code owner March 19, 2025 10:49
Comment on lines +14 to +18
/**
* A Promise that allows the function to respond immediately while still waiting
* for the operation to complete asynchronously.
*/
waitUntil: Promise<any>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is currently an incorrect type definition, as waitUntil is a method and not itself a Promise

I've made a suggested change below:

Suggested change
/**
* A Promise that allows the function to respond immediately while still waiting
* for the operation to complete asynchronously.
*/
waitUntil: Promise<any>
/**
* The waitUntil method enables the application to carry on executing after the response has been sent.
* The method has to be called at-least once synchronously before the response has beent sent, but after that it can be called multiple times, and will hold the keep the application running until all the promises passed to it have settled.
*/
waitUntil(f: Promise<any>): void;

Copy link
Author

Choose a reason for hiding this comment

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

Currently I have to pass a promise, rather than a function, to get this to work otherwise I get "i.catch is not a function"

Copy link
Contributor

@JakeChampion JakeChampion left a comment

Choose a reason for hiding this comment

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

I believe the type definition is currently incorrect, I've left a comment with a suggested change 👍

@lemusthelroy
Copy link
Author

This is the wrong place to do this as this available to v2 only

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants