Skip to content

Instantly share code, notes, and snippets.

@LFSCamargo
Created February 7, 2019 02:35
Show Gist options
  • Save LFSCamargo/9434a149869926259e4e0e7f8cb49cc2 to your computer and use it in GitHub Desktop.
Save LFSCamargo/9434a149869926259e4e0e7f8cb49cc2 to your computer and use it in GitHub Desktop.
function types Typescript or flow
// Function that executes a action and dont receive any params and returns void
type ChangesSomething = () => void
// Function that receives a string and returns a string
type FormatName = (name: string) => string
// Function that checks if a string is null and returns a boolean
type CheckNull = (value: string) => boolean
// Function that sums two numbers and returns a number
type Sum = (n1: number, n2: number) => number
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment