Closed blazzjosh closed 2 years ago
Yes, you can. The example you provided will work out of the box. Here’s a REPL to demonstrate:
https://svelte.dev/repl/24dd3ad1df394a9d8bc6333a2e7a19d3?version=3.48.0
@kbrgl did something change since then . In a sveltekit (typescript) project. I get the error
Type '(data: any) => string' is not assignable to type 'Renderable'.
where Renderable is defined as
export declare type Renderable = typeof SvelteComponent | string | null;
as per the code . So
(args:any) => string
is not covered by the Renderable type ?? Sorry i had to add this to a closed issue.
if i do this however
const customMessage = (arg: any): string => { }
export declare type Renderable = typeof SvelteComponent | typeof customMessage | string | null;
The error goes away .havent tested though. will test now and maybe do a PR if that is fine by you
Can i provide a function to the success/error messages to incorporate the result/error of the promise?