Skip to content

Instantly share code, notes, and snippets.

@jaroslav-kubicek
Created November 22, 2019 23:35
Show Gist options
  • Save jaroslav-kubicek/ef2d0244f1415654cb1f507ddbba2ecd to your computer and use it in GitHub Desktop.
Save jaroslav-kubicek/ef2d0244f1415654cb1f507ddbba2ecd to your computer and use it in GitHub Desktop.
/* @flow */
// uncomment this comment :) // flowlint unclear-type:error
// SEE https://flow.org/en/docs/linting/rule-reference/#toc-unclear-type
// "any" type - not very helpful
const foo: any = 42;
foo.bar.baz
// primitives
const name: string = "kubajz";
const age: number = 30;
const falsy: boolean = false;
// object
type Person = { name: string, surname: string, sex: "MALE" | "FEMALE" }
const variables: Person = {
name: "Jarda",
surname: "Kubicek",
sex: "MALE",
};
// function
const getName = (person: Person) => {
return person.name;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment