Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is plain object fix #305

Closed
wants to merge 73 commits into from
Closed

Is plain object fix #305

wants to merge 73 commits into from

Conversation

michalkvasnicak
Copy link
Contributor

When isPlainObject is called between two different contexts then Object.prototype is not the same. Now it is comparing only stringified constructors. Fixes #304

gaearon and others added 30 commits June 30, 2015 23:52
Naming:

* “Stateless Stores” are now called reducers. (#137 (comment))
* The “Redux instance” is now called “The Store”. (#137 (comment))
* The dispatcher is removed completely. (#166 (comment))

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: #113 (comment).

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. (#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.
…menter

Modify test case ID generation for reducer changing
Discovered a subtle and confounding bug with composeMiddleware where
it only works if dispatch is the last argument. It did not combine
multiple middlewares into a single middlewares as advertised; it
only combined multiple middlewares with dispatch to create a new
dispatch. This didn't come up earlier because the codebase never
happened to use it in the former way.

This commit fixes the issue and adds a test for it.
Added test for shallowEqualScalar in connect decorator
Dispatch sends action through entire middleware chain
emmenko and others added 24 commits July 14, 2015 19:20
…compose

Compose applyMiddleware dispatch once.
Flow types, take 3 (actually 4)
- 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
Allow es6 symbols to be used as action types
Add JSDoc annotations to the public API
…s instead of prototypes (did not work from iframes because Object in iframe is not the same as in parent)
@michalkvasnicak
Copy link
Contributor Author

Ah, wrong branch, sorry :(

@gaearon
Copy link
Contributor

gaearon commented Jul 23, 2015

The PR should probably be done against breaking-changes-1.0 branch

@gaearon
Copy link
Contributor

gaearon commented Jul 24, 2015

This was merged as #306.

@gaearon gaearon closed this Jul 24, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants