Skip to content

Instantly share code, notes, and snippets.

@gabrielyotoo
Last active September 23, 2024 20:30
Show Gist options
  • Save gabrielyotoo/b3641377bf49e5f81bc169501107772a to your computer and use it in GitHub Desktop.
Save gabrielyotoo/b3641377bf49e5f81bc169501107772a to your computer and use it in GitHub Desktop.
[Function] - Thunk function that receives other function's parameters as its own parameters
const thunkFunctionMultiParams =
<T extends unknown[], R>(fn: (...params: T) => R, ...params: T) =>
() => fn(...params);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment