@@ -7,6 +7,7 @@ export const endTransition = createAction('@@router/END_TRANSITION', payload =>
77// reducer
88const initialState = {
99 path : null ,
10+ location : null ,
1011 route : null ,
1112 status : null ,
1213 params : null ,
@@ -15,21 +16,25 @@ const initialState = {
1516} ;
1617export const reducer = handleActions ( {
1718 [ startTransition ] : ( state , { payload } ) => {
18- // refactor: https://github.com/Microsoft/TypeScript/issues/2103
19- return Object . assign ( { } , state , payload ) ;
19+ return {
20+ ...state ,
21+ ...payload
22+ }
2023 } ,
2124 [ endTransition ] : ( state , { payload } ) => {
22- // refactor: https://github.com/Microsoft/TypeScript/issues/2103
23- return Object . assign ( { } , state , payload ) ;
25+ return {
26+ ...state ,
27+ ...payload
28+ }
2429 }
2530} , { initialState } ) ;
2631
2732// hook
2833export const hookRedux = ( { dispatch } ) => ( {
29- start : ( { path } ) => {
30- dispatch ( startTransition ( { path } ) ) ;
34+ start : ( { path, location } ) => {
35+ dispatch ( startTransition ( { path, location } ) ) ;
3136 } ,
32- resolve : ( { path , route, status, params, redirect } ) => {
33- dispatch ( endTransition ( { path , route, status, params, redirect } ) ) ;
37+ resolve : ( { route, status, params, redirect } ) => {
38+ dispatch ( endTransition ( { route, status, params, redirect } ) ) ;
3439 }
3540} ) ;
0 commit comments