With this change you can use `bindActionCreators` to either bind a
object of actionCreator functions to dispatch or only a single
actionCreator directly.
import { bindActionCreators } from 'redux';
import { addTodo } from './actions/todoActions';
const boundAddTodo = bindActionCreators(addTodo, dispatch);
boundAddTodo('Hello');
- Symbols are a good way to ensure uniqueness of your action types
- In Chrome and Firefox, a symbol inside of a template literal throws an
error. Making the string conversion explicit gets rid of the error
Naming:
* “Stateless Stores” are now called reducers. (https://github.com/gaearon/redux/issues/137#issuecomment-114178411)
* The “Redux instance” is now called “The Store”. (https://github.com/gaearon/redux/issues/137#issuecomment-113252359)
* The dispatcher is removed completely. (https://github.com/gaearon/redux/pull/166#issue-90113962)
API changes:
* <s>`composeStores`</s> is now `composeReducers`.
* <s>`createDispatcher`</s> is gone.
* <s>`createRedux`</s> is now `createStore`.
* `<Provider>` now accepts `store` prop instead of <s>`redux`</s>.
* The new `createStore` signature is `createStore(reducer: Function | Object, initialState: any, middlewares: Array | ({ getState, dispatch }) => Array)`.
* If the first argument to `createStore` is an object, `composeReducers` is automatically applied to it.
* The “smart” middleware signature changed. It now accepts an object instead of a single `getState` function. The `dispatch` function lets you “recurse” the middleware chain and is useful for async: https://github.com/gaearon/redux/issues/113#issuecomment-112603386.
Correctness changes:
* The `dispatch` provided by the default thunk middleware now walks the whole middleware chain.
* It is enforced now that raw Actions at the end of the middleware chain have to be plain objects.
* Nested dispatches are now handled gracefully. (https://github.com/gaearon/redux/pull/110)
Internal changes:
* The object in React context is renamed from <s>`redux`</s> to `store`.
* Some tests are rewritten for clarity, focus and edge cases.
* Redux in examples is now aliased to the source code for easier work on master.