File tree 2 files changed +14
-4
lines changed 2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -7,23 +7,25 @@ const SELECT_STATE = state => state.routing;
7
7
8
8
// Action creator
9
9
10
- function pushPath ( path , state , avoidRouterUpdate ) {
10
+ function pushPath ( path , state , opts ) {
11
+ opts = opts || { } ;
11
12
return {
12
13
type : UPDATE_PATH ,
13
14
path : path ,
14
15
state : state ,
15
16
replace : false ,
16
- avoidRouterUpdate : ! ! avoidRouterUpdate
17
+ avoidRouterUpdate : ! ! opts . avoidRouterUpdate
17
18
} ;
18
19
}
19
20
20
- function replacePath ( path , state , avoidRouterUpdate ) {
21
+ function replacePath ( path , state , opts ) {
22
+ opts = opts || { } ;
21
23
return {
22
24
type : UPDATE_PATH ,
23
25
path : path ,
24
26
state : state ,
25
27
replace : true ,
26
- avoidRouterUpdate : ! ! avoidRouterUpdate
28
+ avoidRouterUpdate : ! ! opts . avoidRouterUpdate
27
29
}
28
30
}
29
31
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ describe('replacePath', () => {
49
49
replace : true ,
50
50
avoidRouterUpdate : true
51
51
} ) ;
52
+
53
+ expect ( replacePath ( '/foo' , undefined , { avoidRouterUpdate : false } ) ) . toEqual ( {
54
+ type : UPDATE_PATH ,
55
+ path : '/foo' ,
56
+ state : undefined ,
57
+ replace : true ,
58
+ avoidRouterUpdate : false
59
+ } ) ;
52
60
} ) ;
53
61
} ) ;
54
62
You can’t perform that action at this time.
0 commit comments