esl icon indicating copy to clipboard operation
esl copied to clipboard

[🐛 in esl-utils]: `debounce` method is incompatible with async void functions typescript 5

Open ala-n opened this issue 1 year ago • 1 comments

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?

ala-n avatar Sep 25 '23 11:09 ala-n

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

fshovchko avatar Jul 08 '24 11:07 fshovchko