Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/imteekay/thinking-in-types

TypeScript examples to build a mental model for types
https://github.com/imteekay/thinking-in-types

javascript nodejs types typescript

Last synced: about 2 months ago
JSON representation

TypeScript examples to build a mental model for types

Awesome Lists containing this project

README

        

# Thinking in Types

This is the source code for the article [A Mental Model to think in Typescript](https://leandrotk.github.io/2020/07/a-mental-model-to-think-in-typescript).

Follow these examples to build a mental model for types:

- [001: JavaScript Types](src/001-javascript-types.ts)
- [002: Simple Sum](src/002-simple-sum.ts)
- [003: Primitive](src/003-primitive.ts)
- [004: Sum all prices](src/004-sum-all-prices.ts)
- [005: Structural vs Nominal Typing](src/005-structural-vs-nominal-typying.ts)
- [006: Runtime vs Compile time](src/006-runtime-vs-compile-time.ts)
- [007: Value space vs Type space](src/007-value-space-vs-type-space.ts)
- [008: Constraints and Type narrowing](src/008-constraints-and-type-narrowing.ts)
- [009: Immutability in compile time](src/009-immutability-in-compile-time.ts)
- [010: Semantics and Readability](src/010-semantics-and-readability.ts)
- [011: Enums](src/011-enums.tsx)
- [012: Optional Property](src/012-optional-properties.ts)
- [013: API Response Optional Property](src/013-api-response-optional-property.ts)
- [014: Union Type](src/014-union-type.ts)
- [015: Intersection Type](src/015-intersection-type.ts)
- [016: Tooling](src/016-tooling.ts)