File tree Expand file tree Collapse file tree 2 files changed +14
-4
lines changed Expand file tree Collapse file tree 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;
77
88// Action creator
99
10- function pushPath ( path , state , avoidRouterUpdate ) {
10+ function pushPath ( path , state , opts ) {
11+ opts = opts || { } ;
1112 return {
1213 type : UPDATE_PATH ,
1314 path : path ,
1415 state : state ,
1516 replace : false ,
16- avoidRouterUpdate : ! ! avoidRouterUpdate
17+ avoidRouterUpdate : ! ! opts . avoidRouterUpdate
1718 } ;
1819}
1920
20- function replacePath ( path , state , avoidRouterUpdate ) {
21+ function replacePath ( path , state , opts ) {
22+ opts = opts || { } ;
2123 return {
2224 type : UPDATE_PATH ,
2325 path : path ,
2426 state : state ,
2527 replace : true ,
26- avoidRouterUpdate : ! ! avoidRouterUpdate
28+ avoidRouterUpdate : ! ! opts . avoidRouterUpdate
2729 }
2830}
2931
Original file line number Diff line number Diff line change @@ -49,6 +49,14 @@ describe('replacePath', () => {
4949 replace : true ,
5050 avoidRouterUpdate : true
5151 } ) ;
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+ } ) ;
5260 } ) ;
5361} ) ;
5462
You can’t perform that action at this time.
0 commit comments