File tree Expand file tree Collapse file tree 2 files changed +5
-8
lines changed
Expand file tree Collapse file tree 2 files changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import wrapActionCreators from '../utils/wrapActionCreators';
66import invariant from 'invariant' ;
77
88const emptySelector = ( ) => ( { } ) ;
9- const emptyBinder = ( ) => ( { } ) ;
9+ const defaultBinder = dispatch => ( { dispatch } ) ;
1010const identityMerge = ( slice , actionsCreators , props ) => ( {
1111 ...props ,
1212 ...slice ,
@@ -23,7 +23,7 @@ export default function createConnect(React) {
2323
2424 return function connect (
2525 select ,
26- dispatchBinder = emptyBinder ,
26+ dispatchBinder = defaultBinder ,
2727 mergeHandler = identityMerge
2828 ) {
2929 const shouldSubscribe = select ? true : false ;
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ describe('React', () => {
5353 expect ( container . context . store ) . toBe ( store ) ;
5454 } ) ;
5555
56- it ( 'should pass the state and the props given component' , ( ) => {
56+ it ( 'should pass state and props to the given component' , ( ) => {
5757 const store = createStore ( ( ) => ( {
5858 foo : 'bar' ,
5959 baz : 42 ,
@@ -244,15 +244,12 @@ describe('React', () => {
244244 expect ( decorated . subscribed ) . toBe ( true ) ;
245245 } ) ;
246246
247- it ( 'should not subscribe to stores if select argument is null ' , ( ) => {
247+ it ( 'should not subscribe to stores if select argument is falsy ' , ( ) => {
248248 const store = createStore ( ( ) => ( {
249249 foo : 'bar'
250250 } ) ) ;
251251
252- @connect (
253- null ,
254- dispatch => ( { dispatch } )
255- )
252+ @connect ( )
256253 class Container extends Component {
257254 render ( ) {
258255 return < div { ...this . props } /> ;
You can’t perform that action at this time.
0 commit comments