kit
kit copied to clipboard
ChannelHandler could be more explicit
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.