-
Notifications
You must be signed in to change notification settings - Fork 18
feat: add type for waitUntil #579
feat: add type for waitUntil #579
Conversation
Co-authored-by: Eduardo Bouças <[email protected]>
| /** | ||
| * A Promise that allows the function to respond immediately while still waiting | ||
| * for the operation to complete asynchronously. | ||
| */ | ||
| waitUntil: Promise<any> |
There was a problem hiding this comment.
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:
| /** | |
| * 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; |
There was a problem hiding this comment.
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"
JakeChampion
left a comment
There was a problem hiding this 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 👍
|
This is the wrong place to do this as this available to v2 only |
Which problem is this pull request solving?
Adds a type definition for
waitUntilChecklist
Please add a
xinside each checkbox: