์ต์ ๋ฌธ์๋ http://ko.redux.js.org์ผ๋ก ๋ฐฉ๋ฌธํ์ฌ ์ฃผ์๊ธฐ ๋ฐ๋๋๋ค.
Redux๋ ์๋ฐ์คํฌ๋ฆฝํธ ์ฑ์ ์ํ ์์ธก ๊ฐ๋ฅํ ์ํ ์ปจํ ์ด๋์ ๋๋ค. (์๋ํ๋ ์ค ํ๋ ์์ํฌ์ธ Redux Framework์ ํผ๋ํ์ง ๋ง์ธ์.)
Redux๋ ์ฌ๋ฌ๋ถ์ด ์ผ๊ด์ ์ผ๋ก ๋์ํ๊ณ , ์๋ก ๋ค๋ฅธ ํ๊ฒฝ(์๋ฒ, ํด๋ผ์ด์ธํธ, ๋ค์ดํฐ๋ธ)์์ ์๋ํ๊ณ , ํ ์คํธํ๊ธฐ ์ฌ์ด ์ฑ์ ์์ฑํ๋๋ก ๋์์ค๋๋ค. ์ฌ๊ธฐ์ ๋ํด์ ์๊ฐ์ฌํํ ๋๋ฒ๊ฑฐ์ ๊ฒฐํฉ๋ ์ค์๊ฐ ์ฝ๋ ์์ ๊ณผ ๊ฐ์ ํ๋ฅญํ ๊ฐ๋ฐ์ ๊ฒฝํ์ ์ ๊ณตํฉ๋๋ค.
์ฌ๋ฌ๋ถ์ Redux๋ฅผ React๋ ๋ค๋ฅธ ๋ทฐ ๋ผ์ด๋ธ๋ฌ๋ฆฌ์ ํจ๊ป ์ฌ์ฉํ ์ ์์ต๋๋ค. Redux๋ ๋งค์ฐ ์์ต๋๋ค (2kB, ์์กด ๋ผ์ด๋ธ๋ฌ๋ฆฌ ํฌํจ).
โโโ โ
โ โ
โ โ
โ โ
โโ
์ฌ๋ฌ๋ถ์ ๋ฐฐ๊ฒฝ์ด๋ ํ์ต๋ฐฉ๋ฒ์ ๊ด๊ณ ์์ด Redux๋ฅผ ๋ฐฐ์ฐ๋ ๋ฐ ๋์์ด ๋ ์ ์๋๋ก ์ฌ๋ฌ ์ข ๋ฅ์ ์๋ฃ๊ฐ ์์ต๋๋ค.
Redux๋ฅผ ์ฒ์ ์ ํด์ ๊ธฐ์ด ๊ฐ๋ ์ ์ดํดํ๊ณ ์ถ๋ค๋ฉด:
The Motivation behind building Redux, the Core Concepts, and the Three Principles.
Redux creator Dan Abramov's free "Getting Started with Redux" video series on Egghead.io
Redux co-maintainer Mark Erikson's "Redux Fundamentals" slideshow and list of suggested resources for learning Reduxโ
If you learn best by looking at code and playing with it, check out our list of Redux example applications, available as separate projects in the Redux repo, and also as interactive online examples on CodeSandbox.
The Redux Tutorials section of the React/Redux links list. Here's a top list of our recommended tutorials:
Dave Ceddia's posts What Does Redux Do? (and when should you use it?) and How Redux Works: A Counter-Example are a great intro to the basics of Redux and how to use it with React, as is this post on React and Redux: An Introduction.
Valentino Gagliardi's post React Redux Tutorial for Beginners: Learning Redux in 2018 is an excellent extended introduction to many aspects of using Redux.
The CSS Tricks article Leveling Up with React: Redux covers the Redux basics well.
This DevGuides: Introduction to Redux tutorial covers several aspects of Redux, including actions, reducers, usage with React, and middleware.
Once you've picked up the basics of working with actions, reducers, and the store, you may have questions about topics like working with asynchronous logic and AJAX requests, connecting a UI framework like React to your Redux store, and setting up an application to use Redux:
The "Advanced" docs section covers working with async logic, middleware, routing.
The Redux docs "Learning Resources" page points to recommended articles on a variety of Redux-related topics.
Sophie DeBenedetto's 8-part Building a Simple CRUD App with React + Redux series shows how to put together a basic CRUD app from scratch.
Going from a TodoMVC app to a real production application can be a big jump, but we've got plenty of resources to help:
Redux creator Dan Abramov's free "Building React Applications with Idiomatic Redux" video series builds on his first video series and covers topics like middleware, routing, and persistence.
The Redux FAQ answers many common questions about how to use Redux, and the "Recipes" docs section has information on handling derived data, testing, structuring reducer logic, and reducing boilerplate.
Redux co-maintainer Mark Erikson's "Practical Redux" tutorial series demonstrates real-world intermediate and advanced techniques for working with React and Redux (also available as an interactive course on Educative.io).
The React/Redux links list has categorized articles on working with reducers and selectors, managing side effects, Redux architecture and best practices, and more.
Our community has created thousands of Redux-related libraries, addons, and tools. The "Ecosystem" docs page lists our recommendations, and there's a complete listing available in the Redux addons catalog.
If you're looking to learn from actual application codebases, the addons catalog also has a list of purpose-built examples and real-world applications.
Finally, Mark Erikson is teaching a series of Redux workshops through Workshop.me. Check the workshop schedule for upcoming dates and locations.
The #redux channel of the Reactiflux Discord community is our official resource for all questions related to learning and using Redux. Reactiflux is a great place to hang out, ask questions, and learn - come join us!
Redux๋ ์ํ๋ฅผ ๊ด๋ฆฌํ๊ธฐ์ ์ข์ ๋๊ตฌ์ด์ง๋ง ์ฌ๋ฌ๋ถ์ ์ํฉ์ ์ ๋นํ์ง๋ ๋ฐ์ ธ ๋ณด์์ผ ํฉ๋๋ค. ๋จ์ง ๋๊ตฐ๊ฐ๊ฐ ์ฌ์ฉํ๋ผ๊ณ ํ๋ค๋ ์ด์ ๋ง์ผ๋ก Redux๋ฅผ ์ฌ์ฉํ์ง๋ ๋ง์ธ์ - ์๊ฐ์ ๋ค์ฌ์ ์ ์ฌ์ ์ธ ์ด์ ๊ณผ ๊ทธ์ ๋ฐ๋ฅธ ๋ฑ๊ฐ๊ตํ์ ๋ํด ์ดํดํ์ธ์.
Redux๋ฅผ ์ฌ์ฉํ ๋งํ ์์ ์ ์๊ธฐ ์ํ ๋ช ๊ฐ์ง ์ ์์ด ์์ต๋๋ค:
์๊ฐ์ ๋ฐ๋ผ ๋ฐ๋๋ ์ถฉ๋ถํ ์์ ๋ฐ์ดํฐ๊ฐ ์๋ค
์ํ๋ฅผ ์ํ ๋จ ํ๋์ ์์ฒ์ด ํ์ํ๋ค
๋ชจ๋ ์ํ๋ฅผ ๊ฐ์ง๊ณ ์๊ธฐ์ ์ต์์ ์ํ๋ ๋ ์ด์ ์ ๋นํ์ง ์๋ค
์ด๋ฌํ ๊ฐ์ด๋๋ผ์ธ์ ์ฃผ๊ด์ ์ด๊ณ ์ ๋งคํ์ง๋ง, ๊ทธ๋ด๋งํ ์ด์ ๊ฐ ์์ต๋๋ค. ๋น์ ์ ์ฑ์ Redux๋ฅผ ์ฌ์ฉํด์ผ ํ ์์ ์ ์ฌ์ฉ์์ ๋ฐ๋ผ ๋ค๋ฅด๊ณ ์ฑ์ ๋ฐ๋ผ ๋ค๋ฆ ๋๋ค.
Redux๊ฐ ์ด๋ป๊ฒ ์ฌ์ฉ๋์ด์ผ ํ๋์ง์ ๋ํ ์ฌ๋ฌ ์๊ฐ๋ค์ ๋ณด๋ ค๋ฉด:
โRedux FAQโ
Dan Abramov (Redux์ ์ ์์)๋ Redux๋ฅผ "Hot Reloading with Time Travel"์ด๋ผ๋ React Europe ๋ฐํ๋ฅผ ์ํด ์์ ํ๋ฉด์ ๋ง๋ค์์ต๋๋ค. ๊ทธ์ ๋ชฉํ๋ ์ต์ํ์ API๋ฅผ ๊ฐ์ง๋ฉด์๋ ์์ ํ ์์ธก ๊ฐ๋ฅํ ํ๋์ ํ๋ ์ํ ๊ด๋ฆฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ๋ง๋ค์ด์, ์ด๋ฅผ ํตํด ๋ก๊น , ํซ ๋ฆฌ๋ก๋ฉ, ์๊ฐ์ฌํ, ์ ๋๋ฒ์ ์ฑ, ๊ธฐ๋ก๊ณผ ์ฌ์ ๋ฑ์ ๊ฐ๋ฐ์์ ๋ ธ๋ ฅ ์์ด๋ ๊ตฌํํ๋ ๊ฒ์ด์์ต๋๋ค.
Redux๋ Flux์ ์์ด๋์ด๋ฅผ ๋ฐ์ ์ํค๋, Elm์ ํ๋ค์ ๊ฐ์ ธ์ด์ผ๋ก์จ ๋ณต์ก์ฑ์ ์ค์์ต๋๋ค. ์ด๋ค์ ์จ๋ณด์ จ๋์ง์ ์๊ด ์์ด, Redux๋ฅผ ์์ํ๋๋ฐ๋ ๋ช ๋ถ์ด๋ฉด ์ถฉ๋ถํฉ๋๋ค.
์์ ๋ฒ์ ์ ์ค์นํ์๋ ค๋ฉด:
npm install --save redux
์ด๋ ์ฌ๋ฌ๋ถ์ด npm์ ํจํค์ง ๋งค๋์ ๋ก ์ฌ์ฉํ๊ณ ์๋ค๊ณ ๊ฐ์ ํฉ๋๋ค.
๋ง์ฝ ์๋๋ผ๋ฉด ์ด๋ค ํ์ผ์ unpkg์์ ์ ๊ทผํด์ ๋ค์ด๋ก๋๋ฐ๊ฑฐ๋ ์ฌ๋ฌ๋ถ์ ํจํค์ง ๋งค๋์ ์ ์ง์ ํด์ฃผ์ธ์.
๋๋ถ๋ถ์ ์ฌ๋๋ค์ Redux๋ฅผ CommonJS ๋ชจ๋๋ก ์ฌ์ฉํฉ๋๋ค. ์ด ๋ชจ๋์ Webpack์ด๋ Browserify ๋๋ Node ํ๊ฒฝ์์ redux
๋ฅผ ์ํฌํธํ ๋ ๋ถ๋ฌ์์ง๋๋ค. ์ฌ๋ฌ๋ถ์ด ์ต์ฒจ๋จ์ ๊ฑท๊ณ ์์ผ๋ฉฐ Rollup์ ์ฌ์ฉํ๋ค๋ฉด ์ด ์ญ์ ์ง์ํฉ๋๋ค.
๋ง์ฝ ์ฌ๋ฌ๋ถ์ด ๋ชจ๋ ๋ฒ๋ค๋ฌ๋ฅผ ์ฌ์ฉํ๊ณ ์์ง ์๋๋ผ๋ ๊ด์ฐฎ์ต๋๋ค. redux
npm ํจํค์ง๋ ๋ฏธ๋ฆฌ ์ปดํ์ผ๋ ํ๋ก๋์
๊ณผ ๊ฐ๋ฐ์ฉ UMD ๋น๋๋ฅผ dist
ํด๋์ ํฌํจํ๊ณ ์์ต๋๋ค. ์ด๋ค์ ๋ฒ๋ค๋ฌ ์์ด ๋ฐ๋ก ์ฌ์ฉ ๊ฐ๋ฅํ๊ณ ๋๋ถ๋ถ์ ์๋ฐ์คํฌ๋ฆฝํธ ๋ชจ๋ ๋ก๋๋ ํ๊ฒฝ๊ณผ ํธํ๋ฉ๋๋ค. ์๋ฅผ ๋ค์ด UMD ๋น๋๋ฅผ ํ์ด์ง ์์ <script>
ํ๊ทธ์์ ์ฌ์ฉํ๊ฑฐ๋ Bower๊ฐ ์ค์นํ๊ฒ ํ ์ ์์ต๋๋ค. UMD ๋น๋๋ Redux๋ฅผ window.Redux
์ ์ญ๋ณ์๋ก ์ฌ์ฉํ๊ฒ ํด์ค๋๋ค.
Redux ์์ค์ฝ๋๋ ES2015๋ก ์์ฑ๋์์ง๋ง CommonJS์ UMD ๋น๋ ๋ชจ๋๋ฅผ ES5๋ก ๋ฏธ๋ฆฌ ์ปดํ์ผํด๋์๊ธฐ ๋๋ฌธ์ ๋ชจ๋ ๋ชจ๋ ๋ธ๋ผ์ฐ์ ์์ ์๋ํฉ๋๋ค. Redux๋ฅผ ์์ํ๊ธฐ์ํด Babel์ด๋ ๋ชจ๋ ๋ฒ๋ค๋ฌ๋ฅผ ์ฌ์ฉํ ํ์๋ ์์ต๋๋ค.
์๋ง ์ฌ๋ฌ๋ถ์ React ๋ฐ์ธ๋ฉ๊ณผ ๊ฐ๋ฐ์ ๋๊ตฌ๋ ํ์ํ์ค๊ฒ๋๋ค.
npm install --save react-reduxnpm install --save-dev redux-devtools
Redux ์์ฒด์๋ ๋ฌ๋ฆฌ Redux ์ํ๊ณ์ ๋ง์ ํจํค์ง๋ค์ UMD ๋น๋๋ฅผ ์ ๊ณตํ์ง ์์ผ๋ฏ๋ก, ํธ์ํ ๊ฐ๋ฐ ๊ฒฝํ์ ์ํด Webpack์ด๋ Browserify ๊ฐ์ CommonJS ๋ชจ๋ ๋ฒ๋ค๋ฌ๋ฅผ ์ฌ์ฉํ๊ธฐ๋ฅผ ๊ถํฉ๋๋ค.
์ฌ๋ฌ๋ถ์ ์ฑ์ ์ํ ์ ๋ถ๋ ํ๋์ ์คํ ์ด(store)์์ ์๋ ๊ฐ์ฒด ํธ๋ฆฌ์ ์ ์ฅ๋ฉ๋๋ค. ์ํ ํธ๋ฆฌ๋ฅผ ๋ณ๊ฒฝํ๋ ์ ์ผํ ๋ฐฉ๋ฒ์ ๋ฌด์์ด ์ผ์ด๋ ์ง ์์ ํ๋ ๊ฐ์ฒด์ธ ์ก์ (action)์ ๋ณด๋ด๋ ๊ฒ ๋ฟ์ ๋๋ค. ์ก์ ์ด ์ํ ํธ๋ฆฌ๋ฅผ ์ด๋ป๊ฒ ๋ณ๊ฒฝํ ์ง ๋ช ์ํ๊ธฐ ์ํด ์ฌ๋ฌ๋ถ์ ๋ฆฌ๋์(reducers)๋ฅผ ์์ฑํด์ผ ํฉ๋๋ค.
์ด๊ฒ ๋ค์ ๋๋ค!
import { createStore } from 'redux'โ/*** ์ด๊ฒ์ด (state, action) => state ํํ์ ์์ ํจ์์ธ ๋ฆฌ๋์์ ๋๋ค.* ๋ฆฌ๋์๋ ์ก์ ์ด ์ด๋ป๊ฒ ์ํ๋ฅผ ๋ค์ ์ํ๋ก ๋ณ๊ฒฝํ๋์ง ์์ ํฉ๋๋ค.** ์ํ์ ๋ชจ์์ ๋น์ ๋ง์๋๋ก์ ๋๋ค: ๊ธฐ๋ณธํ(primitive)์ผ์๋, ๋ฐฐ์ด์ผ์๋, ๊ฐ์ฒด์ผ์๋,* ์ฌ์ง์ด Immutable.js ์๋ฃ๊ตฌ์กฐ์ผ์๋ ์์ต๋๋ค. ์ค์ง ์ค์ํ ์ ์ ์ํ ๊ฐ์ฒด๋ฅผ ๋ณ๊ฒฝํด์๋ ์๋๋ฉฐ,* ์ํ๊ฐ ๋ฐ๋๋ค๋ฉด ์๋ก์ด ๊ฐ์ฒด๋ฅผ ๋ฐํํด์ผ ํ๋ค๋ ๊ฒ์ ๋๋ค.** ์ด ์์์์ ์ฐ๋ฆฌ๋ `switch` ๊ตฌ๋ฌธ๊ณผ ๋ฌธ์์ด์ ์ผ์ง๋ง,* ์ฌ๋ฌ๋ถ์ ํ๋ก์ ํธ์ ๋ง๊ฒ* (ํจ์ ๋งต ๊ฐ์) ๋ค๋ฅธ ์ปจ๋ฒค์ ์ ๋ฐ๋ฅด์ ๋ ์ข์ต๋๋ค.*/function counter(state = 0, action) {switch (action.type) {case 'INCREMENT':return state + 1case 'DECREMENT':return state - 1default:return state}}โ// ์ฑ์ ์ํ๋ฅผ ๋ณด๊ดํ๋ Redux ์คํ ์ด๋ฅผ ๋ง๋ญ๋๋ค.// API๋ก๋ { subscribe, dispatch, getState }๊ฐ ์์ต๋๋ค.let store = createStore(counter)โ// ์ ๋ฐ์ดํธ๋ฅผ ์ง์ ๊ตฌ๋ ํ๊ฑฐ๋ ๋ทฐ ๋ ์ด์ด์ ๋ฐ์ธ๋ฉํ ์ ์์ต๋๋ค.// ๋ณดํต์ subscribe()๋ฅผ ์ง์ ์ฌ์ฉํ๊ธฐ๋ณด๋ค๋ ๋ทฐ ๋ฐ์ธ๋ฉ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(์๋ฅผ ๋ค์ด React Redux)๋ฅผ ์ฌ์ฉํฉ๋๋ค.// ํ์ง๋ง ํ์ฌ ์ํ๋ฅผ localStorage์ ์์์ ์ผ๋ก ์ ์ฅํ ๋๋ ํธ๋ฆฌํฉ๋๋ค.โstore.subscribe(() =>console.log(store.getState()))โ// ๋ด๋ถ ์ํ๋ฅผ ๋ณ๊ฒฝํ๋ ์ ์ผํ ๋ฐฉ๋ฒ์ ์ก์ ์ ๋ณด๋ด๋ ๊ฒ๋ฟ์ ๋๋ค.// ์ก์ ์ ์ง๋ ฌํ๋ ์๋, ๋ก๊น ํ ์๋, ์ ์ฅํ ์๋ ์์ผ๋ฉฐ ๋์ค์ ์ฌ์คํํ ์๋ ์์ต๋๋ค.store.dispatch({ type: 'INCREMENT' })// 1store.dispatch({ type: 'INCREMENT' })// 2store.dispatch({ type: 'DECREMENT' })// 1
์ํ๋ฅผ ๋ฐ๋ก ๋ณ๊ฒฝํ๋ ๋์ , ์ก์ ์ด๋ผ ๋ถ๋ฆฌ๋ ํ๋ฒํ ๊ฐ์ฒด๋ฅผ ํตํด ์ผ์ด๋ ๋ณ๊ฒฝ์ ๋ช ์ํฉ๋๋ค. ๊ทธ๋ฆฌ๊ณ ๊ฐ๊ฐ์ ์ก์ ์ด ์ ์ฒด ์ ํ๋ฆฌ์ผ์ด์ ์ ์ํ๋ฅผ ์ด๋ป๊ฒ ๋ณ๊ฒฝํ ์ง ๊ฒฐ์ ํ๋ ํน๋ณํ ํจ์์ธ ๋ฆฌ๋์๋ฅผ ์์ฑํฉ๋๋ค.
๋ง์ฝ ์ฌ๋ฌ๋ถ์ด Flux๋ฅผ ๊ฐ๋ฐํ๋ค๊ฐ ์๋ค๋ฉด, ์์๋ฌ์ผ ํ ์ค์ํ ์ฐจ์ด์ ์ด ์์ต๋๋ค. Redux๋ Dispatcher๊ฐ ์๊ณ ์คํ ์ด ์ฌ๋ฌ๊ฐ๋ฅผ ์ง์ํ์ง๋ ์์ต๋๋ค. ๋์ ๋ฃจํธ ๋ฆฌ๋์ฑ ํจ์ ํ๋๋ฅผ ๊ฐ์ง๋ ๋จ ํ๋์ ์คํ ์ด๊ฐ ์์ต๋๋ค. ๋น์ ์ ์ฑ์ด ์ปค์ง๋ฉด ์คํ ์ด๋ฅผ ์ถ๊ฐํ๋ ๋์ ๋ฃจํธ ๋ฆฌ๋์๋ฅผ ์ชผ๊ฐ์ ์ํ ํธ๋ฆฌ์ ๊ฐ๊ธฐ ๋ค๋ฅธ ๋ถ๋ถ์ ๋ ๋ฆฝ์ ์ผ๋ก ๋ค๋ฃจ๋ ๋ฆฌ๋์๋ค์ ๋ง๋ค๋ฉด ๋ฉ๋๋ค. ๋ง์น React ์ฑ์๋ ํ๋์ ๋ฃจํธ ์ปดํฌ๋ํธ๊ฐ ์๊ณ ์ด ๋ฃจํธ ์ปดํฌ๋ํธ๊ฐ ์ฌ๋ฌ๊ฐ์ ์์ ์ปดํฌ๋ํธ๋ก ์ด๋ฃจ์ด์ง ๊ฒ์ฒ๋ผ์.
์ด ์ํคํ ์ณ๋ ์ซ์ ์ธ๋ ์ฑ ํ๋ ๋ง๋๋๋ฐ์๋ ๊ณผ๋ํด ๋ณด์ผ ์ ์์ง๋ง ์ด ํจํด์ ์๋ฆ๋ค์์ ํฌ๊ณ ๋ณต์กํ ์ฑ์ผ๋ก ํ์ฅํ๊ธฐ ์ข๋ค๋ ์ ์ ๋๋ค. ์ด๋ ๋ํ ์ก์ ์ด ์ผ์ผํค๋ ๋ชจ๋ ๋ณ๊ฒฝ์ ์ถ์ ํจ์ผ๋ก์จ ๊ฐ๋ ฅํ ๊ฐ๋ฐ์ ๋๊ตฌ๋ฅผ ๊ฐ๋ฅํ๊ฒ ํฉ๋๋ค. ์ฌ๋ฌ๋ถ์ ์ก์ ์ ์ฌ์ํ๋ ๊ฒ๋ง์ผ๋ก ์ฌ์ฉ์ ์ธ์ ์ ๊ธฐ๋กํ๊ณ ์ฌ์์ฐํ ์ ์์ต๋๋ค.
โGetting Started with Redux is a video course consisting of 30 videos narrated by Dan Abramov, author of Redux. It is designed to complement the โBasicsโ part of the docs while bringing additional insights about immutability, testing, Redux best practices, and using Redux with React. This course is free and will always be.
โโGreat course on egghead.io by @dan_abramov - instead of just showing you how to use #redux, it also shows how and why redux was built!โ Sandrino Di Mattia
โโPlowing through @dan_abramov 'Getting Started with Redux' - its amazing how much simpler concepts get with video.โ Chris Dhanaraj
โโThis video series on Redux by @dan_abramov on @eggheadio is spectacular!โ Eddie Zaneski
โโThis series of videos on Redux by @dan_abramov is repeatedly blowing my mind - gunna do some serious refactoringโ Laurence Roberts
So, what are you waiting for?
Note: If you enjoyed Dan's course, consider supporting Egghead by buying a subscription. Subscribers have access to the source code of every example in my videos and tons of advanced lessons on other topics, including JavaScript in depth, React, Angular, and more. Many Egghead instructors are also open source library authors, so buying a subscription is a nice way to thank them for the work that they've done.
The Building React Applications with Idiomatic Redux course is a second free video series by Dan Abramov. It picks up where the first series left off, and covers practical production ready techniques for building your React and Redux applications: advanced state management, middleware, React Router integration, and other common problems you are likely to encounter while building applications for your clients and customers. As with the first series, this course will always be free.
โPractical Redux is a paid interactive course by Redux co-maintainer Mark Erikson. The course is designed to show how to apply the basic concepts of Redux to building something larger than a TodoMVC application. It includes real-world topics like:
Adding Redux to a new Create-React-App project and configuring Hot Module Replacement for faster development
Controling your UI behavior with Redux
Using the Redux-ORM library to manage relational data in your Redux store
Building a master/detail view to display and edit data
Writing custom advanced Redux reducer logic to solve specific problems
Optimizing performance of Redux-connected form inputs
And much more!
The course is based on Mark's original free "Practical Redux" blog tutorial series, but with updated and improved content.
Redux co-maintainer Mark Erikson has put together a Redux Fundamentals workshop, and slides are available here. They cover:
The history and purpose of Redux
Reducers, actions, and working with a Redux store
Using Redux with React
Using and writing Redux middleware
Working with AJAX calls and other side effects
Unit testing Redux apps
Real-world Redux app structure and development
โ์๊ฐโ
โ๊ธฐ์ดโ
โ์ฌํโ
โ๋ ์ํผโ
โFAQโ
โ๋ฌธ์ ํด๊ฒฐโ
โ์ฉ์ด์ฌ์ โ
โAPI ๋ ํผ๋ฐ์คโ
์คํ๋ผ์ธ์์ ์ฝ๊ธฐ ์ํ PDF, ePub, MOBI ๋ฒ์ ์ ๋ฐ๊ฑฐ๋ ์ด๋ป๊ฒ ๋ง๋๋์ง ์๊ณ ์ถ๋ค๋ฉด, paulkogel/redux-offline-docs์ ๋ณด์ธ์.
Offline ๋ฌธ์๋ devdocs์ ๋ณด์ธ์.
Almost all examples have a corresponding CodeSandbox sandbox. This is an interactive version of the code that you can play with online.
โCounter Vanilla: Sourceโ
โTodos with Undo: Source | Sandboxโ
โShopping Cart: Source | Sandboxโ
โReal World: Source | Sandboxโ
๋ง์ฝ ์ฌ๋ฌ๋ถ์ด NPM ์ํ๊ณ๊ฐ ์์ํ๊ณ ํ๋ก์ ํธ๋ฅผ ์์ํ๋๋ฐ ๋ฌธ์ ๊ฐ ์๊ฑฐ๋ ์์ ์ฝ๋๋ฅผ ์ด๋์ ๋ถ์ฌ๋ฃ์ด์ผ ํ ์ง ๋ชจ๋ฅด๊ฒ ๋ค๋ฉด, Redux๋ฅผ React์ Browserify์ ํจ๊ป ์ฌ์ฉํ๋ simplest-redux-example์ ์ฐธ๊ณ ํ์ธ์.
โ"Love what youโre doing with Redux" Jing Chen, creator of Flux
โ"I asked for comments on Redux in FB's internal JS discussion group, and it was universally praised. Really awesome work." Bill Fisher, creator of Flux
โ"It's cool that you are inventing a better Flux by not doing Flux at all." Andrรฉ Staltz, creator of Cycle
โThe Elm Architecture for a great intro to modeling state updates with reducers;
โTurning the database inside-out for blowing my mind;
โDeveloping ClojureScript with Figwheel for convincing me that re-evaluation should "just work";
โWebpack for Hot Module Replacement;
โFlummox for teaching me to approach Flux without boilerplate or singletons;
โdisto for a proof of concept of hot reloadable Stores;
โNuclearJS for proving this architecture can be performant;
โOm for popularizing the idea of a single state atom;
โCycle for showing how often a function is the best tool;
โReact for the pragmatic innovation.
NPM ํจํค์ง๋ช
์ธ redux
๋ฅผ ๋๊ฒจ์ฃผ์ Jamie Paton์๊ฒ ํน๋ณํ ๊ฐ์ฌ์ ๋ง์ ์ ํฉ๋๋ค.
๊ณต์ ๋ก๊ณ ๋ฅผ GitHub์์ ์ฐพ์๋ณด์ค ์ ์์ต๋๋ค.
์ด ํ๋ก์ ํธ๋ ์ ์์ ๋ฒ์ ์ ๋ฐ๋ฆ ๋๋ค. ๋งค ๋ฆด๋ฆฌ์ฆ๋ ๋ง์ด๊ทธ๋ ์ด์ ์ค๋ช ๊ณผ ํจ๊ป ๊นํ ๋ฆด๋ฆฌ์ฆ ํ์ด์ง์ ๋ฌธ์ํ๋ฉ๋๋ค.
Redux ์์ ์ ์ปค๋ฎค๋ํฐ์ ์ํด ํ๋ฉ๋์์ต๋๋ค. ์ด๋ฅผ ๊ฐ๋ฅํ๊ฒ ํ๋ ์ฃผ์ํ ํ์ฌ๋ค์ ์๊ฐํฉ๋๋ค.
โ์ ์ฒด ํ์์ ๋ช ๋จ๊ณผ ์ง์์ ์ผ๋ก ๋์ด๋๊ณ ์๋ Redux๋ฅผ ์ฌ์ฉํ๋ ์ฌ๋๊ณผ ํ์ฌ๋ค ๋ชฉ๋ก์ ๋ณผ ์ ์์ต๋๋ค.
MIT
ํ๊ตญ์ด ๋ฒ์ญ ๊ธฐ์ฌ๋ Github ์ ์ฅ์๋ก ํ ๋ฆฌํ์คํธ๋ฅผ ๋ณด๋ด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค.