https://github.com/nwtgck/egghead-todo-typescript-react
Type-safe TODO list app in React + Redux + TypeScript
https://github.com/nwtgck/egghead-todo-typescript-react
egghead eggheadio react reactjs typescript
Last synced: 2 months ago
JSON representation
Type-safe TODO list app in React + Redux + TypeScript
- Host: GitHub
- URL: https://github.com/nwtgck/egghead-todo-typescript-react
- Owner: nwtgck
- Created: 2017-08-19T03:17:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-08-25T11:43:53.000Z (almost 8 years ago)
- Last Synced: 2024-10-11T15:12:07.262Z (over 1 year ago)
- Topics: egghead, eggheadio, react, reactjs, typescript
- Language: TypeScript
- Homepage:
- Size: 263 KB
- Stars: 2
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Type-safe TODO list app in TypeScript + React + Redux
A Type-safe TODO list application written in TypeScript following by the wonderful lessons of [egghead.io](https://egghead.io/).

## Awesome egghead.io Redux lessons!
This repository is TypeScript version of the lessons bellow.
https://egghead.io/courses/getting-started-with-redux
## Demo page
https://nwtgck.github.io/egghead-todo-typescript-react/build/
## How to run
```sh
$ cd
$ npm install
$ npm start
```
Then, go to http://localhost:8080.
## How to build .html file and bundle.js
```sh
$ cd
$ npm install
$ npm run build
```
Then, you can open `./build/index.html` by your browser.
## Main technologies
* TypeScript
* React
* Redux
* webpack
## Type safety
`Filter`, for example, is seems to be just string.
But only `'SHOW_ALL'`, `'SHOW_ACTIVE'` and `'SHOW_COMPLETED''` are acceptable as `Filter` because `Filter` type is defined bellow.
```ts
type Filter = 'SHOW_ALL' | 'SHOW_ACTIVE' | 'SHOW_COMPLETED';
```
Because of this feature, we can use string more relax without considering typo.
.tsx bellow is valid.
```tsx
All
```
But, the mistake bellow will be detected at compile time. Good!
```tsx
All
```
This is only just one example. Almost things are typed, and some human errors can be detected at compile time.