
TLDR; Here's the code: type Handler = ((...args: any[]) => any) | string; function safeSetTimeout<F extends Handler>( handler: F, timeout?: number, ...args: F extends string ? any[] : Parameters<F extends string ? never : F> ) { retu...
I am a full stack web developer, with a focus on frontend. My main stack is Elm, Typescript, React, Svelte, and ofc node.js.
Markdown supported · ⌘↵ to post
No responses yet.