Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/securingsincity/typescript-talk-demo
Demo repo for my typescript talk
https://github.com/securingsincity/typescript-talk-demo
Last synced: about 13 hours ago
JSON representation
Demo repo for my typescript talk
- Host: GitHub
- URL: https://github.com/securingsincity/typescript-talk-demo
- Owner: securingsincity
- Created: 2017-08-22T03:04:13.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-03T05:33:04.000Z (almost 2 years ago)
- Last Synced: 2024-11-08T02:10:05.653Z (about 2 months ago)
- Language: TypeScript
- Size: 8.79 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TypeScript Talk Demo
This is a set of examples of code for a talk I'm giving on TypeScript. It walks through a bug ridden code example that is fixed by types.
## Step 1 - Bug Ridden Code
The working code
`node bugRidden/example.js`Now change `const user = getUser(0)` to `const user = getUser(1)` and rerun the example. You will receive an error
## Step 2 - Still broken but Typed example using interfaces
* `usingInterfaces` folder
The `usingInterfaces` folder types all of the functions but is still purposely broken. We'll fix it during the talk. You can see the compile errors by either using VSCode or running `tsc --strict usingInterfaces/index.ts`
## Step 3 - Working code in the using classes folder
* `usingClasses` folder
This is now working code. It has since been refactored to use classes as well. It has examples of Union types and classes.
## Step 4 - Example of Intersection Types and extending Interfaces
* `intersectionExample.ts`
## Step 5 - Example of Generics
* `generics.ts`