Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Types in Real Life

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers. →

Types in Real Life

Practical approve to types in javascript

Sibelius Seraphini

July 13, 2018

Transcript

37 slides
  1. - Motivation - Basics - Sum types - Generics -

    REST api study case - React - Redux - Utilities Outline 3
  2. - Better tools support - Code completion - Refactor -

    Documentation - Jump to definition Motivation 6
  3. - Types are set of values - string - 'a'

    | 'b' | 'c' | ... - number - 1 | 2 | 3 | ... - boolean - true | false - function - string -> boolean | ... - object - { a: string, b: number } | ... What are Types? 7
  4. - How to type a function that can be used

    for any type of array (int[], string[], number[])? Generics 16
  5. - type the input - api body payload - headers

    - query string Typing a REST API 19
  6. - type the output (response) - Get a json output

    of a REST api - Transform json to types - https://transform.now.sh/json-to-flo w-types/ Typing a REST API 20
  7. I didn't mention 36 - More about Type Theory -

    Functional Programming - Types + Functional - Fantasy Land specs - Realworld problems and solutions

More Decks by Sibelius Seraphini

Other Decks in Technology