refactor: cleanup TS example
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 16 Oct 2023 20:24:01 +0000 (22:24 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Mon, 16 Oct 2023 20:24:01 +0000 (22:24 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
examples/typescript/worker.ts

index 81d39df3c9eb5c34019dfeeca6e2ab495f6fc982..562b21477e31dd1aaa603a087eb33d3c92b4b130 100644 (file)
@@ -11,8 +11,7 @@ export interface MyResponse {
 
 class MyThreadWorker extends ThreadWorker<MyData, Promise<MyResponse>> {
   constructor () {
-    // eslint-disable-next-line @typescript-eslint/promise-function-async
-    super((data: MyData) => this.process(data), {
+    super(async (data: MyData) => await this.process(data), {
       maxInactiveTime: 60000
     })
   }