cached() option on task() gives TS error
When using task("no-op", () => {}).cached() with TypeScript, cached gives a TS error:
Property 'cached' does not exist on type 'void | TaskFunction'.
Property 'cached' does not exist on type 'void'. ts(2339)
This makes sense, since task() has a union type TaskFunction | void.
I propose removing the void return type option.
https://github.com/microsoft/just/blob/599d32ecf782d825e069cf4dd682f2f7a9596bb7/packages/just-task/src/interfaces.ts#L13-L16
its should be existing as per the line. Any way I guess caching is still under development. Right ? @kenotron
I am in favor of removing the "void" signature now.
I can fix it @kenotron, if you'd like.
@Thisen - oh that'd be appreciated!
I looked a bit into it, seems like removing void, just surfaces another problem.
When I tried to write a test, to see if I could call cached() on the task function, I get a TS error: Cannot invoke an object which is possibly 'undefined'.ts(2722).
Not sure why I get this error, I can't find a possible undefined in the Undertaker typings either.
Do you know @kenotron?
Cannot invoke an object which is possibly 'undefined'.ts(2722).
weird 😕
is it coming when placing the void, if so then it might be declaration bug, else I am not sure.
Issues seem to have gone stale.