Skip to content

Instantly share code, notes, and snippets.

@fauxsaurus
Last active October 20, 2025 17:29
Show Gist options
  • Select an option

  • Save fauxsaurus/2b45f49489d141a8790051940be71b94 to your computer and use it in GitHub Desktop.

Select an option

Save fauxsaurus/2b45f49489d141a8790051940be71b94 to your computer and use it in GitHub Desktop.
An extremely handy utility type for functions.
export type FN<I extends unknown[] = [], O = void> = (...args: I) => O
// usage
type IProps<T> = {callback?: FN; onChange: FN<[T]>; calculate: FN<T[], T>}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment