Skip to content

Commit 01e3303

Browse files
committed
remove cancel action
1 parent 3057be8 commit 01e3303

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

src/index.ts

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ import { createAction, handleActions } from 'redux-actions-helpers';
22

33
// actions
44
export const start = createAction('@@router/START', payload => ({ payload }));
5-
// TODO: remove this action in future
6-
export const resolve = createAction('@@router/RESOLVE', payload => ({ payload }));
75
export const end = createAction('@@router/END', payload => ({ payload }));
86
export const error = createAction('@@router/ERROR', payload => ({ payload }));
9-
export const cancel = createAction('@@router/CANCEL');
7+
// export const cancel = createAction('@@router/CANCEL');
108

119
// reducer
1210
const initialState = {
@@ -20,32 +18,30 @@ const initialState = {
2018
isTransition: false
2119
};
2220
export 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
3533
export 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

Comments
 (0)