Skip to content

Instantly share code, notes, and snippets.

@MichaelDimmitt
Last active March 11, 2024 11:27
Show Gist options
  • Save MichaelDimmitt/2374778fbbfe4083c0c6fb88e80fb75f to your computer and use it in GitHub Desktop.
Save MichaelDimmitt/2374778fbbfe4083c0c6fb88e80fb75f to your computer and use it in GitHub Desktop.
typescript guide

A typescript guide,

  1. learn the primitive types ... number, string, etc.
  2. Unions and Intersections https://www.typescriptlang.org/docs/handbook/unions-and-intersections.html
  3. Pick, Omit, Partial https://dev.to/glebirovich/5-typescript-utility-types-that-will-make-your-life-easier-i44
  4. Typescript how to extract nested type:
    https://stackoverflow.com/questions/56779149/typescript-how-to-extract-nested-type
  5. Learn ? - also ? is not the same as | undefined - but don't focus on this too much.
  6. The "Top Level Type" is the most important type.
    Try to use the type the library gives you for free and get everything inferred from that point onward.
    If you get the Top Level Type wrong you will find that you are typing everything at a micro level and overtyping.

everything else will probably be too much early on.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment