Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- HTML
- ECMAScript
- nodejs
- javscript
- Session
- API
- form
- MongoDB
- express
- CSS
- graphQL
- backend
- clonecoding
- pug
- frontend
- TypeScript
- react
- 자바스크립트
- DART
- JavaScript
- Component
- NextJs
- Flutter
- 리액트
- node.js
- Mongoose
- ES6
- CLONE
- GRID
- heroku
Archives
- Today
- Total
목록dispatch (1)
Enjoy Programming

전 포스팅에 이어 오늘은 redux를 이용해 todo리스트를 만들어보자. 그에 앞서 redux의 중요한 세가지 룰을 알아보자 먼저 Single Source of Truth Redux는 앱의 state를 위해 단 하나의 store를 이용한다. 모든 state가 한곳에 있기 때문에 이렇게 부른다. store의 데이터 구조는 nested된 구조로 이루어져 있다. 자바스크립트 객체로써 {{{{},{},{}},{}}} 이렇게 정리되어 있다. 두번째로 state는 read-only이다. 절대로 직접 mutate하면 안된다. state를 변경하기 위해서는 action을 통해 dispatch되어야 한다. 이말인 즉슨 예를 들어 state가 배열이라면 새로운 값이 들어올때 기존 배열을 push같은 메서드를 이용해 변경해..
JavaScript/Redux
2021. 8. 14. 14:06