esl
esl copied to clipboard
[🐛 in esl-utils]: `debounce` method is incompatible with async void functions typescript 5
Input Code
class Test {
@decorate(debounce, 100) // TS: type are incompatible
protected async update(): Promise<void> {
// ... await
}
}
Expected behavior/code Should wrap async method fine
Environment
- Webpack 5.88.2 + ts-lader 9.4.4
- Node 18; npm 8
- Typescript: 5.2.2
- Target: ES6
Additional context Q: is it a valid situation ootb?
After discussion with @exadel-inc/esl-core-team, it was decided to postpone the issue.
No simple solution was found, since altering types only would introduce additional issue.
Proposed solutions were considered too heavy and would probably require introduction of another parameter in debounced
signature, or altering debouncedSubject