Commit Graph

146 Commits

Author SHA1 Message Date
Daniel Lytkin
085eaec93d Improve typings for compose function (#1868) 2016-07-26 16:59:02 -04:00
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
Erik Michaelson
5fb26a3728 Add a warning for undefined properties passed to combineReducers (#1789)
* Add warning to combineReducers for undefined properties

* Test that it warns for undefined reducer props

* Duh remove only

* add some newlines
2016-07-19 10:53:26 -04:00
Brandon Dail
ea43078be1 Only warn for unexpected key once per key (#1818)
Create key cache in combineReducers

Only define unexpectedKeyCache in dev environment
2016-06-23 01:13:05 +01:00
David Livingston
b523aa4ae5 Issue 1743 (#1770)
* rename createStore param `initialState` to `preloadedState`

* rename configureStore param `initialState` to `preloadedState`

* rename `window.__INITIAL_STATE__` in examples and docs

rename window.__INITIAL_STATE__ to window.__PRELOADED_STATE__
2016-05-27 20:50:45 +01:00
Julien Fontanet
050d425173 feat(compose): optimize one function case (#1701)
* feat(compose): optimize one function case

* style(compose): do not use a variable for funcs.length

* test(compose): add test for a single param
2016-05-08 12:45:00 +01:00
Dan Abramov
f4d80f1889 Keep dispatch available while middleware is initializing (#1647)
* Revert "remove initial assignment of `dispatch` in applyMiddleware to make it more expressive"

This reverts commit 9496fd793b.

* Add test verifying existing behavior
2016-04-20 11:29:51 +01:00
Ben Lesh
64551cb3b6 feat(store): add observable proposal interop to store
- Adds dependency on `symbol-observable` to pull in `Symbol.observable`
- Adds `Symbol.observable` method to the store that returns a generic observable
- Adds comprehensive tests to ensure interoperability. (rxjs 5 was used for a simple integration test, and
  is a dev only dependency)

closes #1631
2016-04-19 22:43:57 +01:00
Igor Oleinikov
9db3dd4f52 Fix typescript test of store enhancer 2016-04-04 18:53:36 -07:00
Igor Oleinikov
324849df22 Improve typing of StoreEnhancer 2016-04-04 17:50:05 -07:00
Igor Oleinikov
658fa6faa4 Fix typescript tests of middlewares. 2016-03-21 23:17:47 -07:00
Igor Oleinikov
e767e13ec5 Improve basic dispatch signature. Fix typescript tests. 2016-03-21 23:13:36 -07:00
Igor Oleinikov
2d2948152a Fix line ending. 2016-03-18 15:53:19 -07:00
Igor Oleinikov
b0d60c4d2a Add state type to Dispatch interface and improve thunk test with proper module augmentation. 2016-03-18 15:51:48 -07:00
Ciuca, Alexandru
74e16aae1c Type safety for dispatch signature 2016-03-17 12:12:16 +02:00
Daniel Lytkin
a5d44fab7a Update TypeScript definitions
Remove redundant type parameters from `Dispatch` type
Remove redundant `combineReducers` overload
Simplify `StoreCreator` type by using optional arguments
Remove redundant type parameters from `Middleware` type
Update `compose` definitions to cover case with zero arguments and case with multiple arguments for innermost function
Add JSDoc
2016-02-24 17:27:50 +06:00
Daniel Lytkin
16325a227b Update TypeScript definitions
Add two more overloads for `bindActionCreators`
2016-02-19 17:24:38 +06:00
Daniel Lytkin
6b61fca446 Fix linter error 2016-02-18 23:07:56 +06:00
Daniel Lytkin
1fa6636d9f Disable timeout for TypeScript definitions tests 2016-02-18 22:46:53 +06:00
Daniel Lytkin
a6b4d80266 Update TypeScript definitions
Add type parameter for `Action`
Stronger typings for `combineReducers`, add `ReducerMapObject` type
Add Unsubscribe type
Stronger typings for `bindActionCreators`, add `ActionCreatorsMapObject` type
Add and refine tests for complete coverage
2016-02-18 18:26:34 +06:00
Daniel Lytkin
b19ebc1695 Update TypeScript definitions
More strict types: replace `any` with type parameters
Add middleware tests
2016-02-18 11:58:53 +06:00
Daniel Lytkin
6b4f7f6495 Add tests for TypeScript definitions 2016-02-17 12:56:13 +06:00
johnsoftek
63fe8503c1 Reword error message for 'reducer returned undefined' 2016-02-10 01:34:02 +10:00
John-David Dalton
e7295c3377 Use lodash v4. 2016-01-31 17:11:59 -08:00
Dan Abramov
81bf90e35a Remove unused variables 2016-01-31 23:13:13 +00:00
Dan Abramov
24aade4731 Fix documentation around nested dispatches and add test to verify it 2016-01-31 21:31:12 +00:00
Dan Abramov
47d00243be Object returned from bindActionCreators() should only include functions 2016-01-30 21:29:38 +00:00
Jamie Dixon
69f8d97762 Removed extra new line after last assertion 2016-01-30 10:40:04 +00:00
Jamie Dixon
5279a93f4c Added tests for more deta types passed to createStore.subscribe 2016-01-30 10:21:35 +00:00
Jamie Dixon
0c5181977c Removed semi-colon from end of toThrow() 2016-01-30 10:11:40 +00:00
Jamie Dixon
d575747aa5 Added check to createStore.subscribe to ensure listener is a function 2016-01-30 09:59:27 +00:00
Aleksandr Petrov
7fa8e861f9 replaceReducer() should throw if argument is not a function 2016-01-30 12:24:06 +03:00
Dan Abramov
b1bcee2746 Don't depend on console object
Fixes #1311
2016-01-29 17:16:31 +00:00
Dan Abramov
147842cf9d Add tests for the new createStore() enhancer arg 2016-01-28 16:32:57 +00:00
Dan Abramov
08aed3ead1 Clarify what tests verify 2016-01-28 16:04:15 +00:00
Sébastien Lorber
a9e615a98d Add parenthesis typo 2016-01-27 23:51:01 +01:00
Sébastien Lorber
35e354a975 Rework a little code that tests #1180 behavior 2016-01-27 23:41:37 +01:00
sebastien
1b5c88937d Add tests for the behavior of unsubscribing affecting next dispatch and not current dispatch listeners (decision of gaearon in #1180) 2016-01-27 11:29:39 +01:00
Andrew Shaffer
c221a5f03c reorganize test folder 2016-01-10 16:03:16 -08:00
Lee Bannard
913afe4e8b Update combineReducers input shape test 2015-12-13 10:20:17 +00:00
Brent Van Minnen
306094df6b handle compose with no functions 2015-11-18 21:11:49 -08:00
Brent Van Minnen
8e19d06f53 composition can be seeded with multiple arguments 2015-11-17 19:00:43 -08:00
Christian Fei
eb9d4f048d fixed typo 2015-11-01 15:59:59 +01:00
Christian Fei
902a9114ca unified test names to use descriptive syntax, not should 2015-11-01 15:56:14 +01:00
Lee Bannard
5b7f63842f Fix lint errors in test/ 2015-10-26 21:27:39 +00:00
Jimmy Jia
f0bff09114 Update ESLint configuration 2015-10-25 17:41:24 -04:00
Dan Abramov
b7031ce3ac Add protection against newer unsubscribe removing older listeners 2015-10-23 14:47:32 +03:00
Dan Abramov
11ab454d02 Remove extra spacing 2015-10-23 14:38:28 +03:00
zilong
56b2fd4871 fix lint error 2015-10-23 16:23:43 +08:00
zilong
e72aa458a0 fixed unsubscribe bug for issue #938 2015-10-23 14:30:11 +08:00