Skip to content

Commit 95a1116

Browse files
committed
😡
1 parent 1a491e3 commit 95a1116

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

‎src/index.ts‎

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,13 @@ export const reducer = handleActions({
3131

3232
// hook
3333
export const firstHookRedux = ({ dispatch, server }) => {
34+
const hook = {};
3435
if (server === true) {
35-
return {};
36-
} else {
37-
return {
38-
render: ({ route, status, params, redirect }) => {
39-
dispatch(end({ route, status, params, redirect, isTransition: false }));
40-
}
36+
hook['render'] = ({ route, status, params, redirect }) => {
37+
dispatch(end({ route, status, params, redirect, isTransition: false }));
4138
}
4239
}
40+
return hook;
4341
};
4442
export const lastHookRedux = ({ dispatch, server }) => {
4543
const hook = {
@@ -55,10 +53,9 @@ export const lastHookRedux = ({ dispatch, server }) => {
5553
}
5654
};
5755
if (server === true) {
58-
return hook['resolve'] = ({ route, status, params, redirect }) => {
56+
hook['resolve'] = ({ route, status, params, redirect }) => {
5957
dispatch(end({ route, status, params, redirect, isTransition: false }));
6058
}
61-
} else {
62-
return hook;
6359
}
60+
return hook;
6461
};

0 commit comments

Comments
 (0)