@@ -9,7 +9,7 @@ function getDisplayName(WrappedComponent) {
9
9
}
10
10
11
11
const defaultMapStateToProps = ( ) => ( { } ) ;
12
- export default function connect ( mapStateToProps , injectExtraPropsKey ) {
12
+ export default function connect ( mapStateToProps ) {
13
13
const shouldSubscribe = ! ! mapStateToProps ;
14
14
const finalMapStateToProps = mapStateToProps || defaultMapStateToProps ;
15
15
return function wrapWithConnect ( WrappedComponent ) {
@@ -25,43 +25,18 @@ export default function connect(mapStateToProps, injectExtraPropsKey) {
25
25
props,
26
26
inject : {
27
27
storeContext : { default : ( ) => ( { } ) } ,
28
- ...( injectExtraPropsKey
29
- ? {
30
- injectExtraContext : {
31
- from : injectExtraPropsKey ,
32
- default : ( ) => ( { } ) ,
33
- } ,
34
- }
35
- : { } ) ,
36
- } ,
37
- computed : {
38
- injectExtraProps ( ) {
39
- return this . injectExtraContext ? this . injectExtraContext . $attrs : { } ;
40
- } ,
41
- injectExtraListeners ( ) {
42
- return this . injectExtraContext ? this . injectExtraContext . $listeners : { } ;
43
- } ,
44
28
} ,
45
29
data ( ) {
46
30
this . store = this . storeContext . store ;
47
- this . preProps = {
48
- ...omit ( getOptionProps ( this ) , [ '__propsSymbol__' ] ) ,
49
- ...this . injectExtraProps ,
50
- } ;
31
+ this . preProps = omit ( getOptionProps ( this ) , [ '__propsSymbol__' ] ) ;
51
32
return {
52
- subscribed : finalMapStateToProps ( this . store . getState ( ) , {
53
- ...this . $props ,
54
- ...this . injectExtraProps ,
55
- } ) ,
33
+ subscribed : finalMapStateToProps ( this . store . getState ( ) , this . $props ) ,
56
34
} ;
57
35
} ,
58
36
watch : {
59
37
__propsSymbol__ ( ) {
60
38
if ( mapStateToProps && mapStateToProps . length === 2 ) {
61
- this . subscribed = finalMapStateToProps ( this . store . getState ( ) , {
62
- ...this . $props ,
63
- ...this . injectExtraProps ,
64
- } ) ;
39
+ this . subscribed = finalMapStateToProps ( this . store . getState ( ) , this . $props ) ;
65
40
}
66
41
} ,
67
42
} ,
@@ -77,10 +52,7 @@ export default function connect(mapStateToProps, injectExtraPropsKey) {
77
52
if ( ! this . unsubscribe ) {
78
53
return ;
79
54
}
80
- const props = {
81
- ...omit ( getOptionProps ( this ) , [ '__propsSymbol__' ] ) ,
82
- ...this . injectExtraProps ,
83
- } ;
55
+ const props = omit ( getOptionProps ( this ) , [ '__propsSymbol__' ] ) ;
84
56
const nextSubscribed = finalMapStateToProps ( this . store . getState ( ) , props ) ;
85
57
if (
86
58
! shallowEqual ( this . preProps , props ) ||
@@ -109,15 +81,15 @@ export default function connect(mapStateToProps, injectExtraPropsKey) {
109
81
} ,
110
82
render ( ) {
111
83
const { $slots = { } , $scopedSlots, subscribed, store } = this ;
112
- const props = { ... getOptionProps ( this ) , ... this . injectExtraProps } ;
84
+ const props = getOptionProps ( this ) ;
113
85
this . preProps = { ...omit ( props , [ '__propsSymbol__' ] ) } ;
114
86
const wrapProps = {
115
87
props : {
116
88
...props ,
117
89
...subscribed ,
118
90
store,
119
91
} ,
120
- on : { ... getListeners ( this ) , ... this . injectExtraListeners } ,
92
+ on : getListeners ( this ) ,
121
93
scopedSlots : $scopedSlots ,
122
94
} ;
123
95
return (
0 commit comments