Closed JerryCauser closed 1 year ago
Right now if I try to use async function as any kind of handlers (get/post/etc...) typescript will alarming me about non-correct type of handler function. It accepts only plain void function.
I am doing a research about bugs in TypeScript, and I am trying to reproduce this bug. But I succeed to assign an async function to a property typed as returning void, just like WebSocketBehavior.message
, without any alarms. It turns out that a function returning Promise
can be assigned to that returning void
, according to this stackoverflow
May I ask what your case was and how the alarm showed?
@JerryZhongJ I'm using ts-standard
and it was pushing some error. I don't remember which one. You can try to reimplement it by yourself by installing ts-standard and desired version of uWS.js.
@JerryZhongJ @typescript-eslint/no-misused-promises
Right now if I try to use async function as any kind of handlers (get/post/etc...) typescript will alarming me about non-correct type of handler function. It accepts only plain void function.