{"action":"created","comment":{"url":"https://api.github.com/repos/chentsulin/redux/pulls/comments/61210415","id":61210415,"diff_hunk":"@@ -1,439 +1,439 @@\n # Redux FAQ\n \n-## General\n+## 一般常見問題\n \n-### When should I use Redux?\n+### 我應該什麼時候使用 Redux？\n \n-Pete Hunt, one of the early contributors to React, says:\n+早期的 React contributor 之一，Pete Hunt 說：\n \n-> You'll know when you need Flux. If you aren't sure if you need it, you don't need it.\n+> 你會知道你哪時候需要 Flux。如果你不確定你是否需要，那就是不需要了。\n \n-Similarly, Dan Abramov, creator of Redux, says:\n+同樣的，Redux 的作者 Dan Abramov 這麼說：\n \n-> I would like to amend this: don't use Redux until you have problems with vanilla React. \n+> 我會想要修改成：不要使用 Redux，直到你在原生的 React 發生了問題。\n \n-In general, use Redux when you have reasonable amounts of data changing over time, you need a single source of truth, and you find that approaches like keeping everything in a top-level React component's state are no longer sufficient.\n+一般來說，在當你有合理的資料量會隨著時間的推移而改變時使用 Redux，你需要唯一的資料來源，而且你發現像是把所有東西保存在頂層 React component 的 state 之類的方法不再是足夠的。\n \n-#### Further information\n-**Documentation**:\n-- [Introduction: Motivation](introduction/Motivation.md)\n+#### 更多資訊\n+**文件**\n+- [簡介：動機](introduction/Motivation.md)\n \n-**Discussions**:\n+**討論**\n - [React How-To](https://github.com/petehunt/react-howto)\n-- [Twitter - Don't use Redux until...](https://twitter.com/dan_abramov/status/699241546248536064)\n-- [The Case for Flux](https://medium.com/swlh/the-case-for-flux-379b7d1982c6)\n-- [Stack Overflow - Why use Redux over Facebook Flux?](http://stackoverflow.com/questions/32461229/why-use-redux-over-facebook-flux)\n-- [Stack Overflow - Why should I use Redux in this example?](http://stackoverflow.com/questions/35675339/why-should-i-use-redux-in-this-example)\n-- [Stack Overflow - What could be the downsides of using Redux instead of Flux?](http://stackoverflow.com/questions/32021763/what-could-be-the-downsides-of-using-redux-instead-of-flux)\n+- [Twitter - 不要使用 Redux，直到...](https://twitter.com/dan_abramov/status/699241546248536064)\n+- [Flux 的案例](https://medium.com/swlh/the-case-for-flux-379b7d1982c6)\n+- [Stack Overflow - 為什麼 Redux 會超越 Facebook 的 Flux？ Flux?](http://stackoverflow.com/questions/32461229/why-use-redux-over-facebook-flux)\n+- [Stack Overflow - 為什麼我應該要在這個範例使用 Redux？](http://stackoverflow.com/questions/35675339/why-should-i-use-redux-in-this-example)\n+- [Stack Overflow - 使用 Redux 而不是 Flux，缺點可能是什麼？](http://stackoverflow.com/questions/32021763/what-could-be-the-downsides-of-using-redux-instead-of-flux)\n \n-### Can Redux only be used with React?  \n+### Redux 只能用在 React 嗎？\n \n-Redux can be used as a data store for any UI layer.  The most common usage is with React, but there are bindings available for Angular, Vue, Mithril, and more.  Redux simply provides a subscription mechanism, which can be used by any other code.\n+在任何的 UI 層，Redux 可以被用來當作資料儲存。最常見的就是被用在 React，除此之外還可用在 Angular、Vue、Mithril 等等。Redux 只是提供一個訂閱的機制，它可以被用在任何其他的程式碼。\n \n \n-### Do I need to have a particular build tool to use Redux?\n+### 我需要特定的建構工具來使用 Redux 嗎？\n \n-Redux is written in ES6 and built for production with Webpack and Babel.  However, it should be usable in any Javascript build process.  There is also a UMD build that allows usage without any build process at all.  The [counter-vanilla](https://github.com/reactjs/redux/tree/master/examples/counter-vanilla) example demonstrates basic ES5 usage with Redux included in a script tag.  As the pull request that added this said:\n+Redux 是由 ES6 所撰寫的，並建立於 Webpack 和 Babel。然而，它應該是可以用在任何 JavaScript 建構環境。還有一個是 UMD 版本，可以不需要任何建構工具就可以使用。[counter-vanilla](https://github.com/reactjs/redux/tree/master/examples/counter-vanilla) 示範透過 script 標籤引入 Redux 並使用基本的 ES5 來撰寫。就如同此 Pull Request 所加入的一段話：\n \n-> The new Counter Vanilla example is aimed to dispel the myth that Redux requires Webpack, React, hot reloading, sagas, action creators, constants, Babel, npm, CSS modules, decorators, fluent Latin, an Egghead subscription, a PhD, or an Exceeds Expectations O.W.L. level.\n+> 新的 Counter 原生範例意旨在於去除 Redux 需要 Webpack、React、hot reloading、sagas、action creators、constants、Babel、npm、CSS modules、decorators、fluent Latin、一個 Egghead 的訂閱、一個 PhD，或是一個超過預期的 O.W.L. 水準的迷思。\n \n->Nope, it's just HTML, some artisanal `<script>` tags, and plain old DOM manipulation. Enjoy!\n+> 以上皆非，只需要 HTML 還有一些 `<script>` tag 的引入，簡單的透過 DOM 來操作就可以了。Enjoy！\n \n \n ## Reducers\n \n-### How do I share state between two reducers? Do I have to use `combineReducers`?\n+### 我要如何在兩個 reducers 共用 state？我一定要使用 `combineReducers` 嗎？\n \n-The suggested structure for a Redux store is to split the state object into multiple \"slices\" or \"domains\" by key, and provide a separate reducer function to manage each individual data slice.  This is similar to how the standard Flux pattern has multiple independent stores, and Redux provides the [`combineReducers`](api/combineReducers.md) utility function to make this pattern easier.  However, it's important to note that `combineReducers` is NOT required - it is simply a utility function for the common use case of having a single reducer function per state slice, with plain Javascript objects for the data.\n+Redux store 建議的結構是透過 key 來拆分成多個 「slice」或「domains」state 物件，並提供一個單獨的 reducer function 來管理每個獨立的資料部份。這是類似於標準的 Flux 模式有多個獨立的 store，而 Redux 提供了 [`combineReducers`](api/combineReducers.md) function 讓這個模式更加簡單。然而，重要的是要注意到 `combineReducers` 不是必要的 - 它是一個簡單有效的工具，對於共同使用具有單一的 reducer function 的 state 切分和簡單的 JavaScript 物件的資料。\n \n-Many users later want to try to share data between two reducers, but find that `combineReducers` does not allow them to do so.  There are several approaches that can be used:\n+許多使用者之後想要嘗試在兩個 reducer 間共用資料，但是發現 `combineReducers` 不允許他們這麼做。這裡有幾種可以使用的方法：\n \n-* If a reducer needs to know data from another slice of state, the store may need to be reorganized so that a single reducer is handling more of the data.\n-* You may need to write some custom functions for handling some of these actions.  This may require replacing `combineReducers` with your own top-level reducer function.  You can also use a utility such as [reduce-reducers](https://github.com/acdlite/reduce-reducers) to run `combineReducers` to handle most actions, but also run a more specialized reducer for specific actions that cross state slices.\n-* [Async action creators](advanced/AsyncActions.md) such as `redux-thunk` have access to the entire state through `getState()`.  An action creator can retrieve additional data from the state and put it in an action, so that each reducer has enough information to update its own state slice.\n+* 如果 reducer 需要知道資料是來自 state 的哪個部份，store 應該需要重新被組合，讓單一的 reducer 可以處理更多的資料。\n+* 你可能需要撰寫一些自訂的 function 來處理一些 action。這可能需要將你的頂層 reducer function 來替代 `combineReducers`。你也可以使用一些有用的工具像是 [reduce-reducers](https://github.com/acdlite/reduce-reducers) 來執行 `combineReducers` 處理大部分的 action，同時執行更多 reducer 對於跨越不同 state 所指定的 action。\n+* [非同步 action creator](advanced/AsyncActions.md) 像是 `redux-thunk` 可以透過 `getState()` 存取所有的 state。Action creator 可以從 state 或是一個 action 取得額外的資料，所以每個 reducer 有更多的資訊可以更新他們本身的 state 部份。\n \n-In general, remember that reducers are just functions - you can organize them and subdivide them any way you want, and you are encouraged to break them down into smaller, reusable functions (\"reducer decomposition\").  You just need to make sure that together they follow the basic rules of reducers: `(state, action) -> newState`, and update state immutably rather than mutating it directly.\n+一般情況下，記住 reducer 只是 function - 你可以根據你想要的方式來組織和區分他們，並鼓勵你將他們拆分成更小，可複用的 function （「reducer decomposition」）。你只需要確保這些 reducer 都遵守這些基本的規則： `(state, action) -> newState`，透過更新 state 來取得新的 state，而不要直接的修改 state。\n \n-#### Further information:\n-**Documentation**:\n-- [API: combineReducers](api/combineReducers.md)\n+#### 更多資訊\n+**文件**\n+- [API：combineReducers](api/combineReducers.md)\n \n-**Discussions**:\n-- [#601 - A concern on combineReducers, when an action is related to multiple reducers](https://github.com/reactjs/redux/issues/601)\n-- [#1400 - Is passing top-level state object to branch reducer an anti-pattern?](https://github.com/reactjs/redux/issues/1400)\n-- [Stack Overflow - Accessing other parts of the state when using combined reducers?](http://stackoverflow.com/questions/34333979/accessing-other-parts-of-the-state-when-using-combined-reducers)\n-- [Stack Overflow - Reducing an entire subtree with redux combineReducers](http://stackoverflow.com/questions/34427851/reducing-an-entire-subtree-with-redux-combinereducers)\n-- [Sharing State Between Redux Reducers](https://invalidpatent.wordpress.com/2016/02/18/sharing-state-between-redux-reducers/)\n+**討論**\n+- [#601 - 當一個 action 與多個 reducers 有關時，在 combineReducers 所要關注的問題](https://github.com/reactjs/redux/issues/601)\n+- [#1400 - 傳送頂層 state 物件到其他分支的 reducer 是一個 anti-pattern 嗎？](https://github.com/reactjs/redux/issues/1400)\n+- [Stack Overflow - 當使用 combine reducers，可以存取其他部分的 state 嗎？](http://stackoverflow.com/questions/34333979/accessing-other-parts-of-the-state-when-using-combined-reducers)\n+- [Stack Overflow - Reduce 整個 subtree 與 redux combineReducer](http://stackoverflow.com/questions/34427851/reducing-an-entire-subtree-with-redux-combinereducers)\n+- [在 Redux Reducer 間共用 State](https://invalidpatent.wordpress.com/2016/02/18/sharing-state-between-redux-reducers/)\n \n \n-### Do I have to use a switch statement to handle actions?\n+### 我一定要使用 switch 條件式來處理 action 嗎？\n \n-No.  You are welcome to use any approach you'd like to respond to an action in a reducer.  A switch statement is the most common approach, but it's fine to use if statements, a lookup table of functions, or create a function that abstracts the process.\n+不是的，你可以使用任何你想要的方式在 reducer 中來應對 action。switch 條件式只是最常見的方法，但用 if 條件式、一個查詢 function 的列表，或是建立一個 function來抽象化處理也都可以。\n \n-#### Further information:\n-**Documentation**:\n-- [Recipes: Reducing Boilerplate](recipes/ReducingBoilerplate.md)\n+#### 更多資訊\n+**文件**\n+- [Recipes：Reducing Boilerplate](recipes/ReducingBoilerplate.md)\n \n-**Discussions**:\n-- [#883 - take away the huge switch block](https://github.com/reactjs/redux/issues/883)\n-- [#1167 - Reducer without switch](https://github.com/reactjs/redux/issues/1167)\n+**討論**\n+- [#883 - 消除龐大的 switch block](https://github.com/reactjs/redux/issues/883)\n+- [#1167 - Reducer 沒有 switch](https://github.com/reactjs/redux/issues/1167)\n \n \n-## Organizing State\n+## 組織 State\n \n-### Do I have to put all my state into Redux? Should I ever use React's setState?\n+### 我一定要把我所有的 state 放入 Redux 嗎？我應該使用 React 的 setState 嗎？\n \n-There is no \"right\" answer for this.  Some users prefer to keep every single piece of data in Redux, to maintain a fully serializable and controlled version of their application at all times.  Others prefer to keep non-critical or UI state, such as \"is this dropdown currently open\", inside a component's internal state.  Find a balance that works for you, and go with it.\n+這沒有「正確」的答案。有些使用者喜歡將每個單一的資料部份放入 Redux，來管理完全序列化以及在任何時候都可以控制應用程式的版本。有些人則偏好 non-critical 或 UI state，像是「目前打開的下拉選單」，內部 component 的內部 state。其實只要找到一個你覺得平衡的方式就可以了。\n \n-There are a number of community packages that implement various approaches for storing per-component state in a Redux store instead, such as [redux-ui](https://github.com/tonyhb/redux-ui), [redux-component](https://github.com/tomchentw/redux-component), [redux-react-local](https://github.com/threepointone/redux-react-local), and more.\n+在 community 有各種大量不同的實作，來替代每個 component 的 state 儲存到 Redux 的 store 方法，像是 [redux-ui](https://github.com/tonyhb/redux-ui), [redux-component](https://github.com/tomchentw/redux-component)、[redux-react-local](https://github.com/threepointone/redux-react-local)，還有更多其他不同實作。\n \n-#### Further information\n-**Discussions**:\n-- [#159 - Investigate using Redux for pseudo-local component state](https://github.com/reactjs/redux/issues/159)\n-- [#1098 - Using Redux in reusable React component](https://github.com/reactjs/redux/issues/1098)\n-- [#1287 - How to choose between Redux's store and React's state?](https://github.com/reactjs/redux/issues/1287)\n-- [#1385 - What are the disadvantages of storing all your state in a single immutable atom?](https://github.com/reactjs/redux/issues/1385)\n-- [Stack Overflow - Why is state all in one place, even state that isn't global?](http://stackoverflow.com/questions/35664594/redux-why-is-state-all-in-one-place-even-state-that-isnt-global)\n-- [Stack Overflow - Should all component state be kept in Redux store?](http://stackoverflow.com/questions/35328056/react-redux-should-all-component-states-be-kept-in-redux-store)\n+#### 更多資訊\n+**討論**\n+- [#159 - 探討使用 Redux 對於 pseudo-local component state](https://github.com/reactjs/redux/issues/159)\n+- [#1098 - 在可重複使用的 React component 使用 Redux](https://github.com/reactjs/redux/issues/1098)\n+- [#1287 - 如何在 Redux 的 store 和 React 的 state 之間做選擇？](https://github.com/reactjs/redux/issues/1287)\n+- [#1385 - 將你所有的 state 儲存在單一的不可變 atom 缺點是什麼？](https://github.com/reactjs/redux/issues/1385)\n+- [Stack Overflow - 為什麼 state 都在同一處，甚至連非全域的 state 也是？](http://stackoverflow.com/questions/35664594/redux-why-is-state-all-in-one-place-even-state-that-isnt-global)\n+- [Stack Overflow - 所有的 component state 都應該要保留在 Redux 的 store 嗎？](http://stackoverflow.com/questions/35328056/react-redux-should-all-component-states-be-kept-in-redux-store)\n \n \n-### Can I put functions, promises, or other non-serializable items in my store state?\n+### 我可以在 store state 內放置 function、promise、或其他非序列的項目嗎？\n \n-It is highly recommended that you only put plain serializable objects, arrays, and primitives into your store.  It's _technically_ possible to insert non-serializable items into the store, but doing so can break the ability to persist and rehydrate the contents of a store.\n+強烈建議你在 store 只放置簡單序列化的物件、陣列、還有 primitives。在_技術上_可以新增非序列的項目到你的 store，但是這麼做會打破不可變的原則還有 store 儲存的內容。\n \n-#### Further information\n-**Discussions**:\n-- [#1248 - Is it ok and possible to store a react component in a reducer?](https://github.com/reactjs/redux/issues/1248)\n-- [#1279 - Have any suggestions for where to put a Map Component in Flux?](https://github.com/reactjs/redux/issues/1279)\n-- [#1390 - Component Loading](https://github.com/reactjs/redux/issues/1390)\n-- [#1407 - Just sharing a great base class](https://github.com/reactjs/redux/issues/1407)\n+#### 更多資訊\n+**討論**\n+- [#1248 - 在 reducer 內可以儲存一個 react component 嗎？](https://github.com/reactjs/redux/issues/1248)\n+- [#1279 - 在 Flux 中，有沒有將 Map Component 放在哪裡的建議？](https://github.com/reactjs/redux/issues/1279)\n+- [#1390 - Component 載入](https://github.com/reactjs/redux/issues/1390)\n+- [#1407 - 只分享一個重要的基本類別](https://github.com/reactjs/redux/issues/1407)\n \n \n-### How do I organize nested/duplicate data in my state?\n+### 我要如何在我的 state 組織巢狀化和重複的資料？\n \n-Data with IDs, nesting, or relationships should generally be stored in a \"normalized\" fashion - each object should be stored once, keyed by ID, and other objects that reference it should only store the ID rather than a copy of the entire object.  It may help to think of parts of your store as a database, with individual \"tables\" per item type.  Libraries such as [normalizr](https://github.com/gaearon/normalizr) and [redux-orm](https://github.com/tommikaikkonen/redux-orm) can provide help and abstractions in managing normalized data.\n+一般來說，資料和 IDs、巢狀化、或是關聯的資料應該被儲存在「normalize」的方式中 - 每個物件應該只被儲存一次，透過 ID 來標記，以及其他參考的物件應該只儲存 IDs，而不是複製整個物件。它可以幫助思考對各個項目類型使用獨立「資料表」，來讓部分 store 像是一個資料庫一樣。像是 [normalizr](https://github.com/gaearon/normalizr) 和 [redux-orm](https://github.com/tommikaikkonen/redux-orm) 的 library 可以提供幫助和管理抽象的 normalize 資料。\n \n \n-#### Further information\n-**Documentation**:\n-- [Advanced: Async Actions](advanced/AsyncActions.md)\n-- [Examples: Real World example](introduction/Examples.html#real-world)\n+#### 更多資訊\n+**文件**\n+- [進階：非同步 Actions](advanced/AsyncActions.md)\n+- [範例：Real World 範例](introduction/Examples.html#real-world)\n \n \n-**Discussions**:\n-- [#316 - How to create nested reducers?](https://github.com/reactjs/redux/issues/316)\n-- [#815 - Working with Data Structures](https://github.com/reactjs/redux/issues/815)\n-- [#946 - Best way to update related state fields with split reducers?](https://github.com/reactjs/redux/issues/946)\n-- [#994 - How to cut the boilerplate when updating nested entities?](https://github.com/reactjs/redux/issues/994)\n-- [#1255 - Normalizr usage with nested objects in React/Redux](https://github.com/reactjs/redux/issues/1255)\n+**討論**\n+- [#316 - 如何建立巢狀的 reducer？](https://github.com/reactjs/redux/issues/316)\n+- [#815 - 處理資料結構](https://github.com/reactjs/redux/issues/815)\n+- [#946 - 使用拆分的 reducer 來更新相關 state 最好的方法？](https://github.com/reactjs/redux/issues/946)\n+- [#994 - 當更新巢狀的實體時，如何減少 boilerplate？](https://github.com/reactjs/redux/issues/994)\n+- [#1255 - 在 React 和 Redux 中，Normalizr 具有巢狀化物件的用法](https://github.com/reactjs/redux/issues/1255)\n \n \n \n-## Store Setup\n+## Store 建立\n \n-### Can I / should I create multiple stores?  Can I import my store directly, and use it in components myself?\n+### 我可以（應該）建立多個 store 嗎？我可以直接匯入我的 store，然後在我的 component 中使用嗎？\n \n-The original Flux pattern describes having multiple \"stores\" in an app, each one holding a different area of domain data.  This can introduce issues such as needing to have one store \"waitFor\" another store to update.  Redux is designed use a variation on this concept, where each individual Flux store would become a separate sub-reducer in the the single Redux store.\n+原來的 Flux 模式描述有多個「store」在你的應用程式，每一個 store 擁有不同的資料部份。這會引入像是 store 需要「等待」其他的 store 更新的 issue。Redux 設計上使用這個概念並將它變化，在 Redux 的 store 中，每個獨立的 Flux store 會是分離的 reducer 。\n \n-As with several other questions, it is _possible_ to create multiple distinct Redux stores in a page, but the intended pattern is to have only a single store.  However, having a single store enables using the Redux DevTools, makes persisting and rehydrating data simpler, and simplifies subscription logic.\n+正如其他的幾個問題，在一個頁面中它是_可以_建立多個不同的 Redux store，但是預期的模式只會有一個單一的 store。然而，擁有單一的 store 可以使用 Redux DevTools，讓不變和 rehydrate 的資料更簡單，並簡化了訂閱的邏輯。\n \n-Similarly, while you _can_ reference your store instance by importing it directly, this is not a recommended pattern in Redux.  For React usage, the wrapper classes generated by the React-Redux `connect()` function do actually look for `props.store` if it exists, but it's best if you simply use a `<Provider store={store} />` at the top of your component chain and let React-Redux worry about the store.  Importing a store directly also makes it harder to leverage server-side rendering.\n+同樣的，雖然你_可以_直接引入你的 store 參考實例，但這不是 Redux 推薦的模式。對於 React 使用方式，透過 React-Redux `connect()` function 產生的 wrapper class 確實會去尋找 `props.store` 是否存在，但是最好的方式是在你的頂部 component 使用一個 `<Provider store={store} />`，讓 React-Redux 去擔心你的 store。直接引入 store 也很難在伺服器端進行 render。\n \n \n \n-#### Further information\n-**Documentation**:\n-- [API: Store](api/Store.md)\n+#### 更多資訊\n+**文件**\n+- [API：Store](api/Store.md)\n \n \n-**Discussions**:\n-- [#1346 - Is it bad practice to just have a 'stores' directory?](https://github.com/reactjs/redux/issues/1436)\n-- [Stack Overflow - Redux multiple stores, why not?](http://stackoverflow.com/questions/33619775/redux-multiple-stores-why-not)\n-- [Stack Overflow - Accessing Redux state in an action creator](http://stackoverflow.com/questions/35667249/accessing-redux-state-in-an-action-creator)\n+**討論**\n+- [#1346 - 有一個「stores」的目錄是不好的做法嗎？](https://github.com/reactjs/redux/issues/1436)\n+- [Stack Overflow - Redux 多個 store，有何不可？](http://stackoverflow.com/questions/33619775/redux-multiple-stores-why-not)\n+- [Stack Overflow - 在一個 action creatro 存取 Redux state](http://stackoverflow.com/questions/35667249/accessing-redux-state-in-an-action-creator)\n \n \n-### Is it OK to have more than one middleware chain in my store enhancer?  What is the difference between \"next\" and \"dispatch\" in a middleware function?\n+### 是不是可以有多個 middleware 鏈在我的 store enhancer？在 middleware function 的「next」和「dispatch」的區別是什麼？\n \n-Redux middleware act like a linked list.  Each middleware function can either call `next(action)` to pass an action along to the next middleware in line, call `dispatch(action)` to restart the processing at the beginning of the list, or do nothing at all to stop the action from being processed further.  \n+Redux middleware 的行為像是一個連結清單。每個 middleware function 可以呼叫 `next(action)` 來傳送一個 action 到下一個 middleware，呼叫 `dispatch(action)` 來重新開始處理清單，或是不做任何事以停止 action 被進一步處理。\n \n-This chain of middleware is defined by the arguments passed to the `applyMiddleware` function used when creating a store.  Defining multiple chains will not work correctly, as they would have distinctly different `dispatch` references and the different chains would effectively be disconnected.\n+當建立 store 時，一連串的 middleware 透過參數來定義並被傳送到 `applyMiddleware` function。定義多個 middleware 鏈無法正常的執行，因為他們明顯有不同參考的 `dispatch`，而且不同的鏈可以有效的被分開。\n \n-#### Further information\n-**Documentation**\n-- [Advanced: Middleware](advanced/Middleware.md)\n-- [API: applyMiddleware](api/applyMiddleware.md)\n+#### 更多資訊\n+**文件**\n+- [進階：Middleware](advanced/Middleware.md)\n+- [API：applyMiddleware](api/applyMiddleware.md)\n \n-**Discussions**\n-- [#1051 - Shortcomings of the current applyMiddleware and composing createStore](https://github.com/reactjs/redux/issues/1051)\n-- [Understanding Redux Middleware](https://medium.com/@meagle/understanding-87566abcfb7a)\n-- [Exploring Redux Middleware](http://blog.krawaller.se/posts/exploring-redux-middleware/)\n+**討論**\n+- [#1051 - 目前 applyMiddleware 和 createStore compse 的缺點](https://github.com/reactjs/redux/issues/1051)\n+- [理解 Redux Middleware](https://medium.com/@meagle/understanding-87566abcfb7a)\n+- [探索 Redux Middleware](http://blog.krawaller.se/posts/exploring-redux-middleware/)\n \n \n-### How do I subscribe to only a portion of the state?  Can I get the dispatched action as part of the subscription?\n+### 我要如何只訂閱部份的 state？我可以取得 dispatch action 當做訂閱的一部分嗎？\n \n-Redux provides a single `store.subscribe` method for notifying listeners that the store has updated.  Listener callbacks do not receive the current state as an argument - it is simply an indication that _something_ has changed.  The subscriber logic can then call `getState()` to get the current state value.\n+Redux 提供了 `store.subscribe` 方法來通知 listeners store 已經更新。Listener callbacks 不會將目前取得的 state 當作參數 - 他只是指出_那些_ state 已經改變。訂閱者可以呼叫 `getState()` 來取得目前的值。\n \n-This API is intended as a low-level primitive with no dependencies or complications, and can be used to build higher-level subscription logic.  UI bindings such as React-Redux can create a subscription for each connected component.  It is also possible to write functions that can intelligently compare the old state vs the new state, and execute additional logic if certain pieces have changed.  Examples include [redux-watch](https://github.com/jprichardson/redux-watch) and [redux-subscribe](https://github.com/ashaffer/redux-subscribe), which offer different approaches to specifying subscriptions and handling changes.\n+這個 API 被作為一個底層的 primitive 沒有任何的依賴或是複雜性，而且可以用在建立頂層的訂閱邏輯。像是 React-Redux 的 UI binding 可以建立一個訂閱給每個被連結的 component。它也可以撰寫 function，而且可以聰明地比較舊的和新的 state，如果某些 state 改變了也可以執行附帶的邏輯。範例包含了 [redux-watch](https://github.com/jprichardson/redux-watch) 和 [redux-subscribe](https://github.com/ashaffer/redux-subscribe)，提供不同的方法來指定訂閱和處理變化。\n \n-The new state is not passed to the listeners in order to remove special-cases and simplify implementing addons such as the Redux DevTools.  In addition, subscribers are intended to react to the state value itself, not the action.  Middleware can be used if dealing with the action is needed.\n+為了排除特殊的情況和簡化實作的附加功能，像是 `Redux DevTools`，新的 state 不會傳送到 listeners。另外，訂閱者的目的是反應 state 本身，而不是 action，如果需要處理 action 可以使用 Middleware。\n \n-#### Further information\n-**Documentation**\n-- [Basics: Store](basics/Store.md)\n-- [API: Store](api/Store.md)\n+#### 更多資訊\n+**文件**\n+- [基礎：Store](basics/Store.md)\n+- [API：Store](api/Store.md)\n \n-**Discussions**\n-- [#303 - subscribe API with state as an argument](https://github.com/reactjs/redux/issues/303)\n-- [#580 - Is it possible to get action and state in store.subscribe?](https://github.com/reactjs/redux/issues/580)\n-- [#922 - Proposal: add subscribe to middleware API](https://github.com/reactjs/redux/issues/922)\n-- [#1057 - subscribe listener can get action param?](https://github.com/reactjs/redux/issues/1057)\n-- [#1300 - Redux is great but major feature is missing](https://github.com/reactjs/redux/issues/1300)\n+**討論**\n+- [#303 - 訂閱 API 和 state 作為參數](https://github.com/reactjs/redux/issues/303)\n+- [#580 - 在 store.subscribe 是可以取得 action 和 state 嗎？](https://github.com/reactjs/redux/issues/580)\n+- [#922 - 建議：加入訂閱到你的 middleware API](https://github.com/reactjs/redux/issues/922)\n+- [#1057 - 訂閱 listener 可以取得 action 的參數嗎？](https://github.com/reactjs/redux/issues/1057)\n+- [#1300 - Redux 很棒但缺少主要功能](https://github.com/reactjs/redux/issues/1300)\n \n \n ## Actions\n \n-### Why should \"type\" be a string, or at least serializable? Why should my action types be constants?\n+### 為什麼「type」要是一個字串，或是至少可以序列化？為什麼我的 action type 要是常數？\n \n-As with state, having actions be serializable enables several of Redux's defining features, such as time travel debugging, and recording and replaying actions.  Using something like a Symbol for the \"type\" value would break that.  Strings are serializable and easily self-descriptive, and so are a better choice.  Note that it IS okay to use Symbols, Promises, or other non-serializable values in an action if the action is intended for use by middleware - actions just need to be serializable by the time they actually reach the store and are passed to reducers.\n+與 state 相同，讓 action 序列化將可使用一些 Redux 定義的功能，像是 time travel debugging，以及 recording 和 replaying actions。使用一些像是 Symbol 的 「type」的值可能會破壞這些。字串序列化可以簡單的描述本身，所以是更好的選擇。請注意，如果 action 是要提供給 middleware 使用，在 action 內可以使用 Symbol、Promise，或是其他非序列化的數值 - 在實際到達 store 和傳送給 reducer 時，action 只需要可以被序列化。\n \n-Encapsulating and centralizing commonly used pieces of code is a key concept in programming.  While it is certainly possible to manually create action objects everywhere, and write each \"type\" value by hand, defining reusable constants makes maintaining code easier.\n+封裝和集中常用的程式碼部份是程式設計中的一個關鍵概念。雖然每個部份可能都要手動建立 action 物件，還要手動撰寫每個「type」的值，定義可複用的常數讓你維護程式碼更容易。\n \n-\n-#### Further information:\n-**Documentation**:\n+#### 更多資訊\n+**文件**\n - [Reducing Boilerplate](http://rackt.github.io/redux/docs/recipes/ReducingBoilerplate.html#actions)\n \n-**Discussion**:\n-- [#384 - Recommend that Action constants be named in the past tense](https://github.com/reactjs/redux/issues/384)\n-- [#628 - Solution for simple action creation with less boilerplate](https://github.com/reactjs/redux/issues/628)\n-- [#1024 - Proposal: Declarative reducers](https://github.com/reactjs/redux/issues/1024)\n-- [#1167 - Reducer without switch](https://github.com/reactjs/redux/issues/1167)\n-- [Stack Overflow - Why do you need 'Actions' as data in Redux?](http://stackoverflow.com/q/34759047/62937)\n-- [Stack Overflow - What is the point of the constants in Redux?](http://stackoverflow.com/q/34965856/62937)\n+\n+**討論**\n+- [#384 - 推薦 Action 常數使用過去時態來命名](https://github.com/reactjs/redux/issues/384)\n+- [#628 - 簡單的 action create 和更少的 boilerplate 的解決方案](https://github.com/reactjs/redux/issues/628)\n+- [#1024 - 建議：宣告 reducer](https://github.com/reactjs/redux/issues/1024)\n+- [#1167 - Reducer 沒有 switch](https://github.com/reactjs/redux/issues/1167)\n+- [Stack Overflow - 在 Redux 為什麼需要將「Action」當作資料？](http://stackoverflow.com/q/34759047/62937)\n+- [Stack Overflow - 在 Redux 常數的點是什麼？](http://stackoverflow.com/q/34965856/62937)\n \n \n-### Is there always a 1-1 mapping between reducers and actions?\n+### reducer 和 action 之間一定是一對一互相對應嗎？\n \n-The actual suggested pattern is to have independent sub-reducer functions that are each responsible for updates to a specific slice of state - the \"reducer composition\" pattern.  A given action could be handled by all, some, or none of them.  Some users do choose to bind them more tightly together, such as the \"ducks\" file structure, but there is definitely not a 1-1 mapping by default.\n+實際上，建議的模式是各個 reducer function 負責各部分的 state 進行更新 - 「reducer composition」模式。一個指定的 action 可以處理所有或是部份 state，也可以沒有。一個指定的 action 可以處理所有或是部份 state，或是完全沒有。有些使用者選擇將 action 和 reducer 更緊密的 bind 在一起，像是「duck」檔案結構， 但預設上不一定要一對一互相對應。\n \n-#### Further information\n-**Documentation**:\n-- [Basics: Reducers](basics/Reducers.md)\n+#### 更多資訊\n+**文件**\n+- [基礎：Reducers](basics/Reducers.md)\n \n \n-**Discussions**:\n-- [Twitter - most common Redux misconception](https://twitter.com/dan_abramov/status/682923564006248448)\n-- [#1167 - Reducer without switch](https://github.com/reactjs/redux/issues/1167)\n-- [Reduxible #8 - Reducers and action creators aren't a one-to-one mapping](https://github.com/reduxible/reduxible/issues/8)\n-- [Stack Overflow - Can I dispatch multiple actions without Redux Thunk middleware?](http://stackoverflow.com/questions/35493352/can-i-dispatch-multiple-actions-without-redux-thunk-middleware/35642783)\n+**討論**\n+- [Twitter - Redux 最常見的誤解](https://twitter.com/dan_abramov/status/682923564006248448)\n+- [#1167 - Reducer 沒有 switch](https://github.com/reactjs/redux/issues/1167)\n+- [Reduxible #8 - Reducer 和 action creator 不是一對一的對應](https://github.com/reduxible/reduxible/issues/8)\n+- [Stack Overflow - 我可以 dispatch 多個 action 而不需要 Redux Thunk middleware 嗎？](http://stackoverflow.com/questions/35493352/can-i-dispatch-multiple-actions-without-redux-thunk-middleware/35642783)\n \n-### How can I represent \"side effects\" such as AJAX calls?  Why do we need things like \"action creators\", \"thunks\", and \"middleware\" to do async behavior?\n+### 我如何表達像是呼叫 AJAX 的 「side effects」？為什麼我們需要像是「action creators」、「thunks」、以及「middleware」來執行非同步的行為？\n \n-This is a long and complex topic, with a wide variety of opinions on how code should be organized and what approaches should be used.\n+這是一個冗長以及複雜的問題，要如何將各式各樣的程式碼組織以及應該使用什麼樣的方法。\n \n-Any meaningful web app needs to execute complex logic, usually including asynchronous work such as making AJAX requests.  That code is no longer purely a function of its inputs, and the interactions with the outside world are known as [\"side effects\"](https://en.wikipedia.org/wiki/Side_effect_%28computer_science%29) \n+任何有意義的 web 應用程式都會需要執行複雜的邏輯，通常包括像是非同步的 AJAX 請求。程式碼不再是單純的輸入 function，以及和外部世界之間相互作用被稱為[「side effects」](https://en.wikipedia.org/wiki/Side_effect_%28computer_science%29)。\n \n-Redux is inspired by functional programming, and out of the box, has no place for side effects to be executed.  In particular, reducer functions MUST always be pure functions of `(state, action) -> newState`.  However, Redux's middleware makes it possible to intercept dispatched actions and add additional complex behavior around them, including side effects.\n+Redux 的靈感來自於 functional programming，它是可以直接使用的，不會有任何的 side effects 執行。尤其是 reducer function，它 **必須** 是 `(state, action) -> newState` 的 pure function。然而，Redux 的 middleware 讓它可以攔截被 dispatch 的 action 並附加額外的複雜行為，包含 side effects。\n \n-In general, Redux suggests that code with side effects should be part of the action creation process.  While that logic _can_ be performed inside of a UI component, it generally makes sense to extract that logic into a reusable function so that the same logic can be called from multiple places - in other words, an action creator function.\n+一般來說，Redux 建議具有 side effect 的程式碼應該是 action creation 處理的一部分。雖然邏輯上_可以_在 UI component 內部被執行，更有意義的方式是將可複用的 function 抽出，相同的邏輯可以在其他地方被呼叫使用 - 換句話說，是一個 action creator function。\n \n-The simplest and most common way to do this is adding the [redux-thunk](https://github.com/gaearon/redux-thunk) middleware, allowing you to write action creators with more complex / async logic.  One  widely-used method is [redux-saga](https://github.com/yelouafi/redux-saga), which lets you write more synchronous-looking code using generators, and can act like \"background threads\" or \"daemons\" in a Redux app.  Another approach is [redux-loop](https://github.com/raisemarketplace/redux-loop), which inverts the process by allowing your reducers to declare side effects in response to state changes and have them executed separately. Beyond that, there are _many_ other community-developed libraries and ideas, each with their own take on how side effects should be managed.\n+最簡單和最常見的方式是增加 [redux-thunk](https://github.com/gaearon/redux-thunk) middleware，讓你可以撰寫更複雜或是非同步邏輯的 action creator。一個被廣泛使用的方法是 [redux-saga](https://github.com/yelouafi/redux-saga)，它使用 generator 讓你可以撰寫更多像是同步的程式碼，可以像是「背景執行序」或「daemons」在你的 Redux 應用程式。另一個方法是 [redux-loop](https://github.com/raisemarketplace/redux-loop)，允許你的 reducer 來宣告 side effects 在回應時的 state 改變，並讓他們分開執行反轉的處理。此外，有_許多_其他由 community 所開發的 library 以及 ideas，每個 libray 都有自己管理 side effects 的方法。\n \n \n-#### Further information\n-**Documentation**:\n-- [Advanced: Async Actions](advanced/AsyncActions.md)\n-- [Advanced: Async Flow](advanced/AsyncFlow.md)\n-- [Advanced: Middleware](advanced/Middleware.md)\n+#### 更多資訊\n+**文件**\n+- [進階：Async Actions](advanced/AsyncActions.md)\n+- [進階：Async Flow](advanced/AsyncFlow.md)\n+- [進階：Middleware](advanced/Middleware.md)\n \n-**Discussions**:\n-- [#291 - Trying to put API calls in the right place](https://github.com/reactjs/redux/issues/291)\n-- [#455 - Modeling side effects](https://github.com/reactjs/redux/issues/455)\n-- [#533 - Simpler introduction to async action creators](https://github.com/reactjs/redux/issues/533)\n-- [#569 - Proposal: API for explicit side effects](https://github.com/reactjs/redux/pull/569)\n-- [#1139 - An alternative side effect model based on generators and sagas](https://github.com/reactjs/redux/issues/1139)\n-- [Stack Overflow - Why do we need middleware for async flow in Redux?](http://stackoverflow.com/questions/34570758/why-do-we-need-middleware-for-async-flow-in-redux)\n-- [Stack Overflow - How to dispatch a Redux action with a timeout?](http://stackoverflow.com/questions/35411423/how-to-dispatch-a-redux-action-with-a-timeout/35415559)\n-- [Stack Overflow - Where should I put synchronous side effects linked to actions in redux?](http://stackoverflow.com/questions/32982237/where-should-i-put-synchronous-side-effects-linked-to-actions-in-redux/33036344)\n-- [Stack Overflow - How to handle complex side-effects in Redux?](http://stackoverflow.com/questions/32925837/how-to-handle-complex-side-effects-in-redux/33036594)\n-- [Stack Overflow - How to unit test async Redux actions to mock ajax response](http://stackoverflow.com/questions/33011729/how-to-unit-test-async-redux-actions-to-mock-ajax-response/33053465)\n-- [Stack Overflow - How to fire AJAX calls in response to the state changes with Redux?](http://stackoverflow.com/questions/35262692/how-to-fire-ajax-calls-in-response-to-the-state-changes-with-redux/35675447)\n-- [Reddit - Help performing Async API calls with Redux-Promise Middleware.](https://www.reddit.com/r/reactjs/comments/469iyc/help_performing_async_api_calls_with_reduxpromise/)\n-- [Twitter - possible comparison between sagas, loops, and other approaches](https://twitter.com/dan_abramov/status/689639582120415232)\n-- [Redux Side-Effects and You](https://medium.com/@fward/redux-side-effects-and-you-66f2e0842fc3)\n-- [Pure functionality and side effects in Redux](http://blog.hivejs.org/building-the-ui-2/)\n+**討論**\n+- [#291 - 嘗試把呼叫 API 放在正確的地方](https://github.com/reactjs/redux/issues/291)\n+- [#455 - 塑造 side effects](https://github.com/reactjs/redux/issues/455)\n+- [#533 - 簡單介紹非同步 action creator](https://github.com/reactjs/redux/issues/533)\n+- [#569 - 建議：API 對於顯式的 side effects](https://github.com/reactjs/redux/pull/569)\n+- [#1139 - 基於 generators 和 sagas 替代 side effect model](https://github.com/reactjs/redux/issues/1139)\n+- [Stack Overflow - 在 Redux 為什麼我們需要 middleware 來處理非同步的流程？](http://stackoverflow.com/questions/34570758/why-do-we-need-middleware-for-async-flow-in-redux)\n+- [Stack Overflow - 如何 dispatch 一個 timeout 的 Redux action？](http://stackoverflow.com/questions/35411423/how-to-dispatch-a-redux-action-with-a-timeout/35415559)\n+- [Stack Overflow - 在 Redux 哪邊應該是我放置同步 side effects 連結到 action 的地方？](http://stackoverflow.com/questions/32982237/where-should-i-put-synchronous-side-effects-linked-to-actions-in-redux/33036344)\n+- [Stack Overflow - 在 Redux 如何處理 side-effects？](http://stackoverflow.com/questions/32925837/how-to-handle-complex-side-effects-in-redux/33036594)\n+- [Stack Overflow - 如何在單元測試非同步 Redux action 來 mock ajax 的 回應？](http://stackoverflow.com/questions/33011729/how-to-unit-test-async-redux-actions-to-mock-ajax-response/33053465)\n+- [Stack Overflow - 如何在 Redux 回應 state 的改變來觸發呼叫 AJAX？](http://stackoverflow.com/questions/35262692/how-to-fire-ajax-calls-in-response-to-the-state-changes-with-redux/35675447)\n+- [Reddit - H說明執行非同步 API 呼叫與 Redux-Promise Middleware。](https://www.reddit.com/r/reactjs/comments/469iyc/help_performing_async_api_calls_with_reduxpromise/)\n+- [Twitter - 在 sagas、loops、以及其他方法之間的比較](https://twitter.com/dan_abramov/status/689639582120415232)\n+- [Redux Side-Effects 和你](https://medium.com/@fward/redux-side-effects-and-you-66f2e0842fc3)\n+- [在 Redux 的 pure functionality 和 side effects](http://blog.hivejs.org/building-the-ui-2/)\n \n-### Should I dispatch multiple actions in a row from one action creator?\n+### 我應該從 action creator 連續 dispatch 多個 action 嗎？\n \n-There's no specific rule for how you should structure your actions.  Using an async middleware like redux-thunk certainly enables scenarios such as dispatching multiple distinct but related actions in a row, dispatching actions to represent progression of an AJAX request, dispatching actions conditionally based on state, or even dispatching an action, then checking the updated state immediately afterwards.  \n+沒有具體的規定你該如何建構你的 action。使用一個非同步 middleware 像是 redux-thunk，像是 dispatch 連續多個但是不相關的 action，dispatch action 來表示 AJAX 請求、dispatch action 基於 state 的狀態、 甚至是 dispatch 一個 action，然後立即檢查更新後的狀態。\n \n-In general, ask if these actions are related but independent, or might actually be the same.  Do what makes sense for your own situation, based on readability and debugging usefulness.\n+一般來說，這些 action 是相關但是獨立的，或者實際上可能是相同的。根據你的情況使用有意義的方式，並基於可讀性和 debug。\n \n \n-#### Further information\n-**Discussions**:\n-- [#597 - Valid to dispatch multiple actions from an event handler?](https://github.com/reactjs/redux/issues/597)\n-- [#959 - Multiple actions one dispatch?](https://github.com/reactjs/redux/issues/959)\n-- [Stack Overflow - Should I use one or several action types to represent this async action?](http://stackoverflow.com/questions/33637740/should-i-use-one-or-several-action-types-to-represent-this-async-action/33816695)\n-- [Stack Overflow - Do events and actions have a 1:1 relationship in Redux?](http://stackoverflow.com/questions/35406707/do-events-and-actions-have-a-11-relationship-in-redux/35410524)\n-- [Stack Overflow - Should actions be handled by reducers to related actions or generated by action creators themselves?](http://stackoverflow.com/questions/33220776/should-actions-like-showing-hiding-loading-screens-be-handled-by-reducers-to-rel/33226443#33226443)\n+#### 更多資訊\n+**討論**\n+- [#597 - 從一個 event handler 有效的 dispatch 多個 action？](https://github.com/reactjs/redux/issues/597)\n+- [#959 - 多個 action 在一個 dispatch？](https://github.com/reactjs/redux/issues/959)\n+- [Stack Overflow - 我應該使用一個或多個 action type 來表示非同步的 action 嗎？](http://stackoverflow.com/questions/33637740/should-i-use-one-or-several-action-types-to-represent-this-async-action/33816695)\n+- [Stack Overflow - 在 Redux 執行事件和 action 是一對一的關係嗎？](http://stackoverflow.com/questions/35406707/do-events-and-actions-have-a-11-relationship-in-redux/35410524)\n+- [Stack Overflow - 應該由 reducer action 來處理相關 action 或者由 action creator 本身來產生 action 嗎？](http://stackoverflow.com/questions/33220776/should-actions-like-showing-hiding-loading-screens-be-handled-by-reducers-to-rel/33226443#33226443)\n \n \n-## Code Structure\n+## 程式碼結構\n \n-### What should my file structure look like? How should I group my action creators and reducers in my project? Where should my selectors go?\n+### 我的檔案結構應該長什麼樣子？在我的專案中，我應該如何組織我的 action creator 和 reducer？我的 selector 應該在哪？\n \n-Since Redux is just a data store library, it has no direct opinion on how your project should be structured.  However, there are a few common patterns that most Redux developers tend to use:\n+因為 Redux 只是一個資料 store library，它沒有直接的方法來如何建構你的專案。然而，有少數幾個是 Redux 開發者最常傾向使用的模式：\n \n-- Rails-style: separate folders for \"actions\", \"constants\", \"reducers\", \"containers\", and \"components\"\n-- Domain-style: separate folders per feature or domain, possibly with sub-folders per file type\n-- \"Ducks\": similar to domain style, but explicitly tying together actions and reducers, often by defining them in the same file\n+- Rails 風格：「actions」、「constants」、「reducers」、「containers」、「components」獨立的資料夾。\n+- Domain 風格：每個功能或 domain 單獨的資料夾，可能有每個檔案類型的子資料夾。\n+- 「Ducks」：類似於 domain 風格，but explicitly tying together actions and reducers, 但是明確的把 action 和 reducer 綁在一起，通常會將他們定義在同個檔案中。\n \n-It's generally suggested that selectors should be defined alongside reducers and exported, then re-used elsewhere (such as in `mapStateToProps` functions or in async action creators) to hide the actual shape of the store.\n+一般認為，selector 應該和 reducer 一起被定義然後匯出，接著在其他地方重新使用（像是在 `mapStateToProps` functions 或者是在非同步 action creators）來隱藏實際的 store 形狀。\n \n-#### Further information\n-**Discussions**:\n-- [#839 - Emphasize defining selectors alongside reducers](https://github.com/reactjs/redux/issues/839)\n-- [#943 - Reducer querying](https://github.com/reactjs/redux/issues/943)\n-- [React-Boilerplate #27 - Application Structure](https://github.com/mxstbr/react-boilerplate/issues/27)\n-- [Stack Overflow - How to structure Redux components/containers](http://stackoverflow.com/questions/32634320/how-to-structure-redux-components-containers/32921576)\n-- [Redux Best Practices](https://medium.com/lexical-labs-engineering/redux-best-practices-64d59775802e)\n-- [Rules For Structuring (Redux) Applications ](http://jaysoo.ca/2016/02/28/organizing-redux-application/)\n+#### 更多資訊\n+**討論**\n+- [#839 - 強調與 reducer 一起定義 selector ](https://github.com/reactjs/redux/issues/839)\n+- [#943 - Reducer 查詢](https://github.com/reactjs/redux/issues/943)\n+- [React-Boilerplate #27 - 應用程式結構](https://github.com/mxstbr/react-boilerplate/issues/27)\n+- [Stack Overflow - 如何建構 Redux components 和 containers？](http://stackoverflow.com/questions/32634320/how-to-structure-redux-components-containers/32921576)\n+- [Redux 最佳作法](https://medium.com/lexical-labs-engineering/redux-best-practices-64d59775802e)\n+- [用於結構化 (Redux) 應用程式的規則](http://jaysoo.ca/2016/02/28/organizing-redux-application/)\n \n-### How should I split my logic between reducers and action creators?  Where should my \"business logic\" go?\n+### 我應該如何將我的 reducer 和 action creator 之間的邏輯拆開？我的「商業邏輯」應該在哪裡？\n \n-There's no single clear answer to exactly what pieces of logic should go in a reducer vs an action creator.  Some developers prefer to have \"fat\" action creators, with \"thin\" reducers that simply take the data in an action and blindly merge it into the corresponding state.  Others try to emphasize keeping actions as small as possible, and minimize usage of `getState` in an action creator.\n+邏輯放置的部份沒有一個明確的答案應該在 reducer 或是 action creator。有些開發者偏好「fat」action creator、「thin」reducer，action 可以簡單的將資料 merge 到相對應的 state，其他人則嘗試保持 action，讓它盡可能的簡單，在 action creator 盡量避免使用到 `getState`。\n \n-This comment sums up the dichotomy nicely:\n+這個討論總結了一個不錯的二分法 ︰\n \n-> Now, the problem is what to put in the action creator and what in the reducer, the choice between fat and thin action objects. If you put all the logic in the action creator, you end up with fat action objects that basically declare the updates to the state. Reducers become pure, dumb, add-this, remove that, update these functions. They will be easy to compose. But not much of your business logic will be there.\n-> If you put more logic in the reducer, you end up with nice, thin action objects, most of your data logic in one place, but your reducers are harder to compose since you might need info from other branches. You end up with large reducers or reducers that take additional arguments from higher up in the state.\n+> 現在的問題是要將什麼放在 action creator、什麼要在 reducer 中，以及 fat 和 thin action 物件之間的選擇。如果你把所有的邏輯放在 action creator，fat action 物件基本上是宣告 state 更新的結果。Reducer 是 pure、dumb、新增、移除、更新的這些功能。他們會更容易 compose。但不代表你大部分的商業邏輯都會在那裡。\n+> 你如果在 reducer 上放了許多邏輯，你就可以有 thin action 物件，大部分的資料邏輯都在一個地方，但是你的 reducer 會很困難 compose，因為你可能需要來自其他 branch 的資訊。你最後可能有一個很大的 reducer 或是 reducer 帶有其他額外的參數來自上層的 state。\n \n \n-#### Further information\n-**Discussions**:\n-- [#1165 - Where to put business logic / validation?](https://github.com/reactjs/redux/issues/1165)\n-- [#1171 - Recommendations for best practices regarding action-creators, reducers, and selectors](https://github.com/reactjs/redux/issues/1171 )\n-- [Stack Overflow - Accessing Redux state in an action creator??](http://stackoverflow.com/questions/35667249/accessing-redux-state-in-an-action-creator/35674575)\n+#### 更多資訊\n+**討論**\n+- [#1165 - 如何放置商業邏輯和驗證？](https://github.com/reactjs/redux/issues/1165)\n+- [#1171 - 關於 action-creators、reducers、和 selectors 最佳做法與建議](https://github.com/reactjs/redux/issues/1171 )\n+- [Stack Overflow - 在一個 action creator 存取 Redux state？](http://stackoverflow.com/questions/35667249/accessing-redux-state-in-an-action-creator/35674575)\n \n \n-## Performance\n+## 效能\n \n-### How well does Redux \"scale\" in terms of performance and architecture?\n+### 依據效能和結構方面來說，如何架構和「scale」Redux ？\n \n-While there's no single definitive answer to this, most of the time this should not be a concern in either case. \n+依然沒有一個明確的答案，大多數這個時候不應該關注這兩種情況。\n \n-The work done by Redux generally falls into a few areas: processing actions in middleware and reducers (including object duplication for immutable updates), notifying subscribers after actions are dispatched, and updating UI components based on state changes.  While it's certainly _possible_ for each of these to become a performance concern in sufficiently complex situations, there's nothing inherently slow or inefficient about how Redux is implemented.  In fact, React-Redux in particular is heavily optimized to cut down on unnecessary re-renders.  \n+一般 Redux 所作的工作分為幾個領域：處理在 middleware 的 action 和 reducer（包含複製不可變的物件來進行更新），在 action 被 dispatch 後通知訂閱者，以及基於 state 的改變來更新 UI component。雖然這些很有_可能_在充滿複雜的情況下變成性能上的問題，但 Redux 的實做本身沒有什麼什麼緩慢和低效的問題。事實上，React-Redux 特別做了大量的優化，減少了不必要的重新 render。\n \n-As for architecture, anecdotal evidence is that Redux works well for varying project and team sizes.  Redux is currently used by hundreds of companies and thousands of developers, with several hundred thousand monthly installations from NPM.  One developer reported:\n+在結構當中，Redux 在各個專案和團隊中都工作的非常順利，數百家公司和上千位開發者目前都在使用 Redux，在 NPM 達到一個月幾十萬次的安裝。一位開發者的報告：\n \n-> for scale, we have ~500 action types, ~400 reducer cases, ~150 components, 5 middlewares, ~200 actions, ~2300 tests\n+> 在規模上，我們有 ~500 action types、~400 reducer cases、~150 components、5 middlewares、~200 actions、 ~2300 tests\n \n-#### Further information\n-**Discussions**:\n-- [#310 - Who uses Redux?](https://github.com/reactjs/redux/issues/310)\n-- [Reddit - What's the best place to keep the initial state?](https://www.reddit.com/r/reactjs/comments/47m9h5/whats_the_best_place_to_keep_the_initial_state/)\n-- [Reddit - Help designing Redux state for a single page app](https://www.reddit.com/r/reactjs/comments/48k852/help_designing_redux_state_for_a_single_page/)\n-- [Reddit - Redux performance issues with a large state object?](https://www.reddit.com/r/reactjs/comments/41wdqn/redux_performance_issues_with_a_large_state_object/)\n+#### 更多資訊\n+**討論**\n+- [#310 - 誰在使用 Redux？](https://github.com/reactjs/redux/issues/310)\n+- [Reddit - 保持初始 state 最好的地方是什麼？](https://www.reddit.com/r/reactjs/comments/47m9h5/whats_the_best_place_to_keep_the_initial_state/)\n+- [Reddit - 設計 Redux state 一個單頁應用程式的説明](https://www.reddit.com/r/reactjs/comments/48k852/help_designing_redux_state_for_a_single_page/)\n+- [Reddit - Redux 的效能 issue 和大型 state 物件？](https://www.reddit.com/r/reactjs/comments/41wdqn/redux_performance_issues_with_a_large_state_object/)\n - [Twitter - Redux scaling](https://twitter.com/NickPresta/status/684058236828266496)\n \n \n-### Won't calling \"all my reducers\" for each action be slow?\n+### 如果在每個 action 呼叫 「我所有的 reducer」會變慢嗎？\n \n-It's important to note that a Redux store really only has a single reducer function.  The store passes the current state and dispatched action to that one reducer function, and lets the reducer handle things appropriately.\n+重要的是，注意 Redux store 一個 reducer function。store 傳送目前的 state 和 dispatch action 到一個 reducer function，並讓 reducer 做適當的處理。\n \n-Obviously, trying to handle every possible action in a single function does not scale well, simply in terms of function size and readability, so it makes sense to split the actual work into separate functions that can be called by the top-level reducer.  In particular, the common suggested pattern is to have a separate sub-reducer function that is responsible for managing updates to a particular slice of state at a specific key, which is made simpler by using the provided `combineReducers` utility.  It's also highly suggested to keep your store state as flat and as normalized as possible.  Ultimately, though, you are in charge of organizing your reducer logic any way you want.\n+很明顯的，將單一的 function 擴充並嘗試處理每個 action 不是這麼容易，簡單來說在於 function 的大小和可讀性，所以要將實際的工作分離成獨立的 function 讓頂層的 reducer 可以呼叫。特別是，共同建議的模式有一個獨立的 reducer function 根據指定的 key 負責管理部份的 state 的更新，透過使用提供的 `combineReducers` 工具可以讓程式變得更簡單。但還是強烈建議將你的 store 扁平化、序列化。最後，你可以根據你需要的方式來組織 reducer 邏輯。\n \n-However, even if you happen to have many different independent sub-reducers, and even have deeply nested state, reducer speed is unlikely to be a problem.  Javascript engines are capable of running a very large number of function calls per second, and most of your sub-reducers are probably just using a switch statement and returning the existing state by default in response to most actions.\n+然而，即便剛好你有許多不同獨立的 reducer，甚至有很深的巢狀 state，reducer 的速度不太可能是一個問題。JavaScript Engine 可以在每秒呼叫並執行大量的 function，你大部份的 reducer 可能都使用 switch 語句，預設上大部分 action 的回應都會回傳存在的 state。\n \n-If you actually are concerned about reducer performance, you can use a utility such as [redux-ignore](https://github.com/omnidan/redux-ignore) or [reduxr-scoped-reducer](https://github.com/chrisdavies/reduxr-scoped-reducer) to ensure that only certain reducers listen to specific actions.  You can also use [redux-log-slow-reducers](https://github.com/michaelcontento/redux-log-slow-reducers) to do some performance benchmarking.\n+如果你很擔心 reducer 實際上的效能，你可以是用像是 [redux-ignore](https://github.com/omnidan/redux-ignore) 或 [reduxr-scoped-reducer](https://github.com/chrisdavies/reduxr-scoped-reducer) 的工具來確保某些 reducer 只監聽指定的 action。你還可以使用 [redux-log-slow-reducers](https://github.com/michaelcontento/redux-log-slow-reducers) 來做一些效能的基準測試。\n \n-#### Further information\n-**Discussions**:\n-- [#912 - Proposal: action filter utility](https://github.com/reactjs/redux/issues/912)\n-- [#1303 - Redux Performance with Large Store and frequent updates](https://github.com/reactjs/redux/issues/1303)\n-- [Stack Overflow - State in Redux app has the name of the reducer](http://stackoverflow.com/questions/35667775/state-in-redux-react-app-has-a-property-with-the-name-of-the-reducer/35674297)\n-- [Stack Overflow - How does Redux deal with deeply nested models?](http://stackoverflow.com/questions/34494866/how-does-redux-deals-with-deeply-nested-models/34495397)\n+#### 更多資訊\n+**討論**\n+- [#912 - 建議：action filter 工具](https://github.com/reactjs/redux/issues/912)\n+- [#1303 - Redux 效能和頻繁的更新大型的 Store](https://github.com/reactjs/redux/issues/1303)\n+- [Stack Overflow - 在 Redux app State 要有 reducer 的名稱](http://stackoverflow.com/questions/35667775/state-in-redux-react-app-has-a-property-with-the-name-of-the-reducer/35674297)\n+- [Stack Overflow - Redux 如何處理深層巢狀的 model？](http://stackoverflow.com/questions/34494866/how-does-redux-deals-with-deeply-nested-models/34495397)\n \n \n-### Do I have to deep-copy my state in a reducer? Isn't copying my state going to be slow?\n+### 我需要在我的 reducer 深層複製我的 state 嗎？複製 state 不會導致變慢嗎？\n \n-Immutably updating state generally means making shallow copies, not deep copies.  Shallow copies should be faster than deep copies, because fewer objects and fields have to be copied, and it effectively comes down to moving some pointers around.\n+Immutable 的更新 state 一般的意思是說淺層複製，而不是深層複製。淺層複製比深層複製來的快，因為較少的物件和欄位被複製，以及可以有效的歸納變動的部份。\n \n-However, you _do_ need to create a copied and updated object for each level of nesting that is affected.  Although that shouldn't be particularly expensive, it's another good reason why you should keep your state normalized and shallow if possible.\n+然而，你需要_將_每個受影響的巢狀層面，建立一個複製和更新的物件。雖然這應該不是特別昂貴，這是一個很好的理由為什麼你應該保持 state 的序列化以及淺層複製。\n \n-> Common Redux misconception: you need to deeply clone the state. Reality: if something inside doesn't change, keep its reference the same!\n+> Redux 常見的誤解：你需要深層 clone state。實際上：如果內部的 state 沒有改變，保持相同的參考！\n \n \n-#### Further information\n-**Discussions**:\n-- [#454 - Handling big states in reducer](https://github.com/reactjs/redux/issues/454)\n-- [#758 - Why can't state be mutated?](https://github.com/reactjs/redux/issues/758)\n-- [#994 - How to cut the boilerplate when updating nested entities?](https://github.com/reactjs/redux/issues/994)\n-- [Twitter - common misconception - deep cloning](https://twitter.com/dan_abramov/status/688087202312491008)\n-- [Cloning Objects in Javascript](http://www.zsoltnagy.eu/cloning-objects-in-javascript/)\n+#### 更多資訊\n+**討論**\n+- [#454 - 在 reducer 處理大型的 state](https://github.com/reactjs/redux/issues/454)\n+- [#758 - 為什麼 state 不能被 mutate？](https://github.com/reactjs/redux/issues/758)\n+- [#994 - 當更新巢狀實體時，如何減少 boilerplate？](https://github.com/reactjs/redux/issues/994)\n+- [Twitter - 常見的誤解 - 深層 clone](https://twitter.com/dan_abramov/status/688087202312491008)\n+- [在 JavaScript 中 Clone 物件](http://www.zsoltnagy.eu/cloning-objects-in-javascript/)\n \n-### How can I reduce the number of store update events?\n+### 我如何減少 store 更新事件的次數？\n \n-Redux notifies subscribers after each successfully dispatched action (ie, the action reached the store and was handled by reducers).  In some cases, it may be useful to cut down on the number of times subscribers are called, particularly if an action creator dispatches multiple distinct actions in a row.  There are a number of community addons that provide batching of subscription notifications after multiple actions are dispatched, such as [redux-batched-updates](https://github.com/acdlite/redux-batched-updates),  [redux-batched-subscribe](https://github.com/tappleby/redux-batched-subscribe), or [redux-batched-actions](https://github.com/tshelburne/redux-batched-actions).\n+Redux 在每次成功 dispatch action 會通知訂閱者（意思是，action 已經去改變 store，並透過 reducer 來處理）。在有些情況下，它可能對於減少呼叫多次訂閱者是有幫助的，特別是如果一個 action creator 連續 dispatch 多個不同的 action。在 community 有一些 addons，在大量的 action 被 dispatch 後，提供透過批次的方式來通知訂閱者，像是 [redux-batched-updates](https://github.com/acdlite/redux-batched-updates)、[redux-batched-subscribe](https://github.com/tappleby/redux-batched-subscribe) 或 [redux-batched-actions](https://github.com/tshelburne/redux-batched-actions)。\n \n-#### Further information\n-**Discussions**:\n-- [#125 - Strategy for avoiding cascading renders](https://github.com/reactjs/redux/issues/125)\n-- [#542 - Idea: batching actions](https://github.com/reactjs/redux/issues/542)\n+#### 更多資訊\n+**討論**\n+- [#125 - 避免 cascade render 的策略](https://github.com/reactjs/redux/issues/125)\n+- [#542 - 方法：batching actions](https://github.com/reactjs/redux/issues/542)\n - [#911 - Batching actions](https://github.com/reactjs/redux/issues/911)\n-- [React-Redux #263 - Huge performance issue when dispatching hundreds of actions](https://github.com/reactjs/react-redux/issues/263)\n+- [React-Redux #263 - 當 dispatch 數百個 action 巨大的效能 issue](https://github.com/reactjs/react-redux/issues/263)\n \n-### Will having \"one state tree\" cause memory problems?  Will dispatching many actions take up memory?  \n+### 如果只有「一個 state tree」會造成記憶體上的問題嗎？如果多次 dispatch 許多 action 會佔用記憶體嗎？\n \n-First, in terms of raw memory usage, Redux is no different than any other Javascript library.  The only difference is that all the various object references are nested together into one tree, instead of maybe saved in various independent model instances such as in Backbone.  Second, a typical Redux app would probably have somewhat _less_ memory usage than an equivalent Backbone app, because Redux encourages use of plain Javascript objects and arrays rather than creating instances of Models and Collections.  Finally, Redux only holds on to a single state tree reference at a time.  Objects that are no longer referenced in that tree will be garbage collected, as standard.\n+首先，在原始記憶體的使用方面，Redux 和其他的 JavaScript libray 沒有什麼不同。唯一的區別是所有的物件參考都被巢狀化成一個 tree，而不是儲存在各個獨立的 model 實例，像是：Backbone。第二，一個典型的 Redux app 記憶體使用 _稍微_ 會比 Backbone app 來的少，因為 Redux 鼓勵你使用純 JavaScript 物件和陣列，而不是建立 Model 和 Collection 的實例。最後，Redux 在每個時間點只有單一 state tree 的參考。根據標準，物件如果不再被 tree 參考將會被垃圾回收。\n \n-Redux does not store a history of actions itself.  However, the Redux DevTools do store actions so they can be replayed, but those are generally only enabled during development, and not used in production.\n+Redux 不會 store action 本身的歷史記錄。然而，Redux DevTools 可以 store action 所以他們可以被 replay，但是一般只會在開發期間使用，不會使用在上線環境。\n \n-#### Further information\n-**Documentation**:\n-- [Docs: Async Actions](advanced/AsyncActions.md])\n+#### 更多資訊\n+**文件**\n+- [文件：非同步 Actions](advanced/AsyncActions.md])","path":"docs/FAQ.md","position":642,"original_position":642,"commit_id":"cbb11395c9e49486257e684a5c9c6d396f686ed3","original_commit_id":"cbb11395c9e49486257e684a5c9c6d396f686ed3","user":{"login":"neighborhood999","id":10325111,"avatar_url":"https://avatars.githubusercontent.com/u/10325111?v=3","gravatar_id":"","url":"https://api.github.com/users/neighborhood999","html_url":"https://github.com/neighborhood999","followers_url":"https://api.github.com/users/neighborhood999/followers","following_url":"https://api.github.com/users/neighborhood999/following{/other_user}","gists_url":"https://api.github.com/users/neighborhood999/gists{/gist_id}","starred_url":"https://api.github.com/users/neighborhood999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neighborhood999/subscriptions","organizations_url":"https://api.github.com/users/neighborhood999/orgs","repos_url":"https://api.github.com/users/neighborhood999/repos","events_url":"https://api.github.com/users/neighborhood999/events{/privacy}","received_events_url":"https://api.github.com/users/neighborhood999/received_events","type":"User","site_admin":false},"body":"_非同步的 Action_ 去除複數","created_at":"2016-04-27T06:35:45Z","updated_at":"2016-04-27T06:35:45Z","html_url":"https://github.com/chentsulin/redux/pull/21#discussion_r61210415","pull_request_url":"https://api.github.com/repos/chentsulin/redux/pulls/21","_links":{"self":{"href":"https://api.github.com/repos/chentsulin/redux/pulls/comments/61210415"},"html":{"href":"https://github.com/chentsulin/redux/pull/21#discussion_r61210415"},"pull_request":{"href":"https://api.github.com/repos/chentsulin/redux/pulls/21"}}},"pull_request":{"url":"https://api.github.com/repos/chentsulin/redux/pulls/21","id":66010349,"html_url":"https://github.com/chentsulin/redux/pull/21","diff_url":"https://github.com/chentsulin/redux/pull/21.diff","patch_url":"https://github.com/chentsulin/redux/pull/21.patch","issue_url":"https://api.github.com/repos/chentsulin/redux/issues/21","number":21,"state":"open","locked":false,"title":"translate FAQ.md","user":{"login":"neighborhood999","id":10325111,"avatar_url":"https://avatars.githubusercontent.com/u/10325111?v=3","gravatar_id":"","url":"https://api.github.com/users/neighborhood999","html_url":"https://github.com/neighborhood999","followers_url":"https://api.github.com/users/neighborhood999/followers","following_url":"https://api.github.com/users/neighborhood999/following{/other_user}","gists_url":"https://api.github.com/users/neighborhood999/gists{/gist_id}","starred_url":"https://api.github.com/users/neighborhood999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/neighborhood999/subscriptions","organizations_url":"https://api.github.com/users/neighborhood999/orgs","repos_url":"https://api.github.com/users/neighborhood999/repos","events_url":"https://api.github.com/users/neighborhood999/events{/privacy}","received_events_url":"https://api.github.com/users/neighborhood999/received_events","type":"User","site_admin":false},"body":"總算是把他翻完了，不過有好多地方感覺翻譯的不太 okay，\r\n在 #20 有稍微記錄，這幾天會再重新 review 再做修改。","created_at":"2016-04-11T15:10:59Z","updated_at":"2016-04-27T06:35:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"751b861c0f0818ee9b8725ebac3499f2bbbe815d","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/chentsulin/redux/pulls/21/commits","review_comments_url":"https://api.github.com/repos/chentsulin/redux/pulls/21/comments","review_comment_url":"https://api.github.com/repos/chentsulin/redux/pulls/comments{/number}","comments_url":"https://api.github.com/repos/chentsulin/redux/issues/21/comments","statuses_url":"https://api.github.com/repos/chentsulin/redux/statuses/cbb11395c9e49486257e684a5c9c6d396f686ed3","head":{"label":"chentsulin:translate-FAQ","ref":"translate-FAQ","sha":"cbb11395c9e49486257e684a5c9c6d396f686ed3","user":{"login":"chentsulin","id":3382565,"avatar_url":"https://avatars.githubusercontent.com/u/3382565?v=3","gravatar_id":"","url":"https://api.github.com/users/chentsulin","html_url":"https://github.com/chentsulin","followers_url":"https://api.github.com/users/chentsulin/followers","following_url":"https://api.github.com/users/chentsulin/following{/other_user}","gists_url":"https://api.github.com/users/chentsulin/gists{/gist_id}","starred_url":"https://api.github.com/users/chentsulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chentsulin/subscriptions","organizations_url":"https://api.github.com/users/chentsulin/orgs","repos_url":"https://api.github.com/users/chentsulin/repos","events_url":"https://api.github.com/users/chentsulin/events{/privacy}","received_events_url":"https://api.github.com/users/chentsulin/received_events","type":"User","site_admin":false},"repo":{"id":39085046,"name":"redux","full_name":"chentsulin/redux","owner":{"login":"chentsulin","id":3382565,"avatar_url":"https://avatars.githubusercontent.com/u/3382565?v=3","gravatar_id":"","url":"https://api.github.com/users/chentsulin","html_url":"https://github.com/chentsulin","followers_url":"https://api.github.com/users/chentsulin/followers","following_url":"https://api.github.com/users/chentsulin/following{/other_user}","gists_url":"https://api.github.com/users/chentsulin/gists{/gist_id}","starred_url":"https://api.github.com/users/chentsulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chentsulin/subscriptions","organizations_url":"https://api.github.com/users/chentsulin/orgs","repos_url":"https://api.github.com/users/chentsulin/repos","events_url":"https://api.github.com/users/chentsulin/events{/privacy}","received_events_url":"https://api.github.com/users/chentsulin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chentsulin/redux","description":"繁體中文 redux 文件翻譯：","fork":true,"url":"https://api.github.com/repos/chentsulin/redux","forks_url":"https://api.github.com/repos/chentsulin/redux/forks","keys_url":"https://api.github.com/repos/chentsulin/redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chentsulin/redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chentsulin/redux/teams","hooks_url":"https://api.github.com/repos/chentsulin/redux/hooks","issue_events_url":"https://api.github.com/repos/chentsulin/redux/issues/events{/number}","events_url":"https://api.github.com/repos/chentsulin/redux/events","assignees_url":"https://api.github.com/repos/chentsulin/redux/assignees{/user}","branches_url":"https://api.github.com/repos/chentsulin/redux/branches{/branch}","tags_url":"https://api.github.com/repos/chentsulin/redux/tags","blobs_url":"https://api.github.com/repos/chentsulin/redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chentsulin/redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chentsulin/redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/chentsulin/redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chentsulin/redux/statuses/{sha}","languages_url":"https://api.github.com/repos/chentsulin/redux/languages","stargazers_url":"https://api.github.com/repos/chentsulin/redux/stargazers","contributors_url":"https://api.github.com/repos/chentsulin/redux/contributors","subscribers_url":"https://api.github.com/repos/chentsulin/redux/subscribers","subscription_url":"https://api.github.com/repos/chentsulin/redux/subscription","commits_url":"https://api.github.com/repos/chentsulin/redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/chentsulin/redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/chentsulin/redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/chentsulin/redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/chentsulin/redux/contents/{+path}","compare_url":"https://api.github.com/repos/chentsulin/redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chentsulin/redux/merges","archive_url":"https://api.github.com/repos/chentsulin/redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chentsulin/redux/downloads","issues_url":"https://api.github.com/repos/chentsulin/redux/issues{/number}","pulls_url":"https://api.github.com/repos/chentsulin/redux/pulls{/number}","milestones_url":"https://api.github.com/repos/chentsulin/redux/milestones{/number}","notifications_url":"https://api.github.com/repos/chentsulin/redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chentsulin/redux/labels{/name}","releases_url":"https://api.github.com/repos/chentsulin/redux/releases{/id}","deployments_url":"https://api.github.com/repos/chentsulin/redux/deployments","created_at":"2015-07-14T15:57:27Z","updated_at":"2016-04-15T03:02:35Z","pushed_at":"2016-04-27T05:30:59Z","git_url":"git://github.com/chentsulin/redux.git","ssh_url":"git@github.com:chentsulin/redux.git","clone_url":"https://github.com/chentsulin/redux.git","svn_url":"https://github.com/chentsulin/redux","homepage":"http://chentsulin.github.io/redux/","size":4060,"stargazers_count":109,"watchers_count":109,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":7,"forks":18,"open_issues":7,"watchers":109,"default_branch":"new-doc-zh-tw"}},"base":{"label":"chentsulin:new-doc-zh-tw","ref":"new-doc-zh-tw","sha":"ecde0366c8836db4d226c255a54632e3814417f1","user":{"login":"chentsulin","id":3382565,"avatar_url":"https://avatars.githubusercontent.com/u/3382565?v=3","gravatar_id":"","url":"https://api.github.com/users/chentsulin","html_url":"https://github.com/chentsulin","followers_url":"https://api.github.com/users/chentsulin/followers","following_url":"https://api.github.com/users/chentsulin/following{/other_user}","gists_url":"https://api.github.com/users/chentsulin/gists{/gist_id}","starred_url":"https://api.github.com/users/chentsulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chentsulin/subscriptions","organizations_url":"https://api.github.com/users/chentsulin/orgs","repos_url":"https://api.github.com/users/chentsulin/repos","events_url":"https://api.github.com/users/chentsulin/events{/privacy}","received_events_url":"https://api.github.com/users/chentsulin/received_events","type":"User","site_admin":false},"repo":{"id":39085046,"name":"redux","full_name":"chentsulin/redux","owner":{"login":"chentsulin","id":3382565,"avatar_url":"https://avatars.githubusercontent.com/u/3382565?v=3","gravatar_id":"","url":"https://api.github.com/users/chentsulin","html_url":"https://github.com/chentsulin","followers_url":"https://api.github.com/users/chentsulin/followers","following_url":"https://api.github.com/users/chentsulin/following{/other_user}","gists_url":"https://api.github.com/users/chentsulin/gists{/gist_id}","starred_url":"https://api.github.com/users/chentsulin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chentsulin/subscriptions","organizations_url":"https://api.github.com/users/chentsulin/orgs","repos_url":"https://api.github.com/users/chentsulin/repos","events_url":"https://api.github.com/users/chentsulin/events{/privacy}","received_events_url":"https://api.github.com/users/chentsulin/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chentsulin/redux","description":"繁體中文 redux 文件翻譯：","fork":true,"url":"https://api.github.com/repos/chentsulin/redux","forks_url":"https://api.github.com/repos/chentsulin/redux/forks","keys_url":"https://api.github.com/repos/chentsulin/redux/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chentsulin/redux/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chentsulin/redux/teams","hooks_url":"https://api.github.com/repos/chentsulin/redux/hooks","issue_events_url":"https://api.github.com/repos/chentsulin/redux/issues/events{/number}","events_url":"https://api.github.com/repos/chentsulin/redux/events","assignees_url":"https://api.github.com/repos/chentsulin/redux/assignees{/user}","branches_url":"https://api.github.com/repos/chentsulin/redux/branches{/branch}","tags_url":"https://api.github.com/repos/chentsulin/redux/tags","blobs_url":"https://api.github.com/repos/chentsulin/redux/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chentsulin/redux/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chentsulin/redux/git/refs{/sha}","trees_url":"https://api.github.com/repos/chentsulin/redux/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chentsulin/redux/statuses/{sha}","languages_url":"https://api.github.com/repos/chentsulin/redux/languages","stargazers_url":"https://api.github.com/repos/chentsulin/redux/stargazers","contributors_url":"https://api.github.com/repos/chentsulin/redux/contributors","subscribers_url":"https://api.github.com/repos/chentsulin/redux/subscribers","subscription_url":"https://api.github.com/repos/chentsulin/redux/subscription","commits_url":"https://api.github.com/repos/chentsulin/redux/commits{/sha}","git_commits_url":"https://api.github.com/repos/chentsulin/redux/git/commits{/sha}","comments_url":"https://api.github.com/repos/chentsulin/redux/comments{/number}","issue_comment_url":"https://api.github.com/repos/chentsulin/redux/issues/comments{/number}","contents_url":"https://api.github.com/repos/chentsulin/redux/contents/{+path}","compare_url":"https://api.github.com/repos/chentsulin/redux/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chentsulin/redux/merges","archive_url":"https://api.github.com/repos/chentsulin/redux/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chentsulin/redux/downloads","issues_url":"https://api.github.com/repos/chentsulin/redux/issues{/number}","pulls_url":"https://api.github.com/repos/chentsulin/redux/pulls{/number}","milestones_url":"https://api.github.com/repos/chentsulin/redux/milestones{/number}","notifications_url":"https://api.github.com/repos/chentsulin/redux/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chentsulin/redux/labels{/name}","releases_url":"https://api.github.com/repos/chentsulin/redux/releases{/id}","deployments_url":"https://api.github.com/repos/chentsulin/redux/deployments","created_at":"2015-07-14T15:57:27Z","updated_at":"2016-04-15T03:02:35Z","pushed_at":"2016-04-27T05:30:59Z","git_url":"git://github.com/chentsulin/redux.git","ssh_url":"git@github.com:chentsulin/redux.git","clone_url":"https://github.com/chentsulin/redux.git","svn_url":"https://github.com/chentsulin/redux","homepage":"http://chentsulin.github.io/redux/","size":4060,"stargazers_count":109,"watchers_count":109,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":18,"mirror_url":null,"open_issues_count":7,"forks":18,"open_issues":7,"watchers":109,"default_branch":"new-doc-zh-tw"}},"_links":{"self":{"href":"https://api.github.com/repos/chentsulin/redux/pulls/21"},"html":{"href":"https://github.com/chentsulin/redux/pull/21"},"issue":{"href":"https://api.github.com/repos/chentsulin/redux/issues/21"},"comments":{"href":"https://api.github.com/repos/chentsulin/redux/issues/21/comments"},"review_comments":{"href":"https://api.github.com/repos/chentsulin/redux/pulls/21/comments"},"review_comment":{"href":"https://api.github.com/repos/chentsulin/redux/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/chentsulin/redux/pulls/21/commits"},"statuses":{"href":"https://api.github.com/repos/chentsulin/redux/statuses/cbb11395c9e49486257e684a5c9c6d396f686ed3"}}}}