Commit Graph

8 Commits

Author SHA1 Message Date
Mike Wilcox
cb5a00b261 throw if getState, subscribe, or unsubscribe called while dispatching (#1569)
* throw error if getState, subscribe, or unsubscribe called while dispatching

* prevent throwing if not subscribed

* update getState error message

* fix space after period

* update subscribe/unsubscribe error messages
2016-07-19 11:36:09 -04:00
Lee Bannard
5b7f63842f Fix lint errors in test/ 2015-10-26 21:27:39 +00:00
Dan Abramov
1f4e7768fe Fix the lint error 2015-09-13 02:47:35 +03:00
Daniel Martinez
71393b7036 Require type to be specified on actions 2015-09-13 02:17:17 +03:00
Dan Schuman
848bb8e175 Throw error when trying to dispatch from action 2015-07-30 16:10:10 -07:00
Dan Abramov
0b5207f4a4 Remove thunk middleware from the core 2015-07-13 02:07:40 +03:00
Dustan Kasten
667d8f5064 state preservation when replacing a reducer: continue incrementing the id 2015-07-01 11:04:46 -04:00
Dan Abramov
e426039152 Breaking API changes for 1.0
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.
2015-06-30 23:52:31 +02:00