Skip to content

Commit f8a61c6

Browse files
committed
split hook into 2 parts
1 parent 5ec9a7b commit f8a61c6

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/index.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,14 @@ export const reducer = handleActions({
3030
}, { initialState });
3131

3232
// hook
33-
export const hookRedux = ({ dispatch }) => ({
34-
start: ({ path, location }) => {
35-
dispatch(start({ path, location, isTransition: true }));
36-
},
33+
export const firstHookRedux = ({ dispatch }) => ({
3734
render: ({ route, status, params, redirect }) => {
3835
dispatch(end({ route, status, params, redirect, isTransition: false }));
36+
}
37+
});
38+
export const lastHookRedux = ({ dispatch }) => ({
39+
start: ({ path, location }) => {
40+
dispatch(start({ path, location, isTransition: true }));
3941
},
4042
error: ({ error: err }) => {
4143
dispatch(error({ err, isTransition: false }));

0 commit comments

Comments
 (0)