kit icon indicating copy to clipboard operation
kit copied to clipboard

ChannelHandler could be more explicit

Open danielo515 opened this issue 2 years ago • 0 comments

Here is the ChannelHandler signature https://github.com/johnlindquist/kit/blob/a31987bf1aaab7e463ea0457f1df30cba6441c3b/src/types/core.d.ts#L251

While it is technically correct, I think it is not clear for typescript. Typescript tells me that the input value is supposed to be a string, and I think it is because you flag it as optional. A more robust type (I think) will be to ensure that undefined is clearly part of it. Something like string|undefined will probably understood better by TS.

danielo515 avatar Feb 03 '23 08:02 danielo515