@@ -2,11 +2,9 @@ import { createAction, handleActions } from 'redux-actions-helpers';
22
33// actions
44export const start = createAction ( '@@router/START' , payload => ( { payload } ) ) ;
5- // TODO: remove this action in future
6- export const resolve = createAction ( '@@router/RESOLVE' , payload => ( { payload } ) ) ;
75export const end = createAction ( '@@router/END' , payload => ( { payload } ) ) ;
86export const error = createAction ( '@@router/ERROR' , payload => ( { payload } ) ) ;
9- export const cancel = createAction ( '@@router/CANCEL' ) ;
7+ // export const cancel = createAction('@@router/CANCEL');
108
119// reducer
1210const initialState = {
@@ -20,32 +18,30 @@ const initialState = {
2018 isTransition : false
2119} ;
2220export const reducer = handleActions ( {
23- [ start + resolve + end + error ] : ( state , { payload } ) => {
21+ [ start + end + error ] : ( state , { payload } ) => {
2422 return {
2523 ...state ,
2624 ...payload
2725 }
28- } ,
26+ } /* ,
2927 [cancel]: () => {
3028 return initialState;
31- }
29+ }*/
3230} , { initialState } ) ;
3331
3432// hook
3533export const hookRedux = ( { dispatch } ) => ( {
3634 start : ( { path, location } ) => {
3735 dispatch ( start ( { path, location, isTransition : true } ) ) ;
3836 } ,
39- resolve : ( { route, status, params, redirect } ) => {
40- dispatch ( resolve ( { route, status, params, redirect } ) ) ;
41- } ,
42- render : ( ) => {
43- dispatch ( end ( { isTransition : false } ) ) ;
37+ render : ( { route, status, params, redirect } ) => {
38+ dispatch ( end ( { route, status, params, redirect, isTransition : false } ) ) ;
4439 } ,
4540 error : ( { error } ) => {
4641 dispatch ( error ( { error, isTransition : false } ) ) ;
4742 } ,
4843 cancel : ( ) => {
49- dispatch ( cancel ( ) ) ;
44+ console . warn ( 'router cancel transition' ) ;
45+ // dispatch(cancel());
5046 }
5147} ) ;
0 commit comments