Closed topce closed 3 years ago
@niklasf indeed it was error
I commit fix to call apply
if (f) setTimeout(() => f.apply(null,args), 1);
if try to call it like before
if (f) setTimeout(() => f(...args), 1);
there is TS compile error
(parameter) args: Parameters
still if you want to get rid of error and do not call apply
it could be ignored
// @ts-ignore if (f) setTimeout(() => f(...args), 1);
@niklasf with last commit it should work same way like before with f(...args) it look like when you call spread operator in function in typescript is not same as if you call apply in javascript it is same but not in TS trick was to change any -> any[] ugly but it works better than other solutions ;-)
Looks good, thanks!
update libs small improvements in typescript typing
export type Key = 'a0' |
${File}${Rank};
export function callUserFunction<T extends (...args: any) => void>( f: T | undefined, ...args: Parameters<T> ): void { if (f) setTimeout(() => f(args), 1); }
fix compile time errors add premove: false, not sure if should be true ?
commit dist files