kn-hooks 0.0.29 → 0.0.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -45,7 +45,7 @@ return(
|
|
|
45
45
|
* @returns {UsePaginationWithFormResult}
|
|
46
46
|
*/
|
|
47
47
|
const usePaginationWithForm = (props) => {
|
|
48
|
-
const {service,pagination,...otherProps}= props;
|
|
48
|
+
const {service,pagination,beforeService=[],...otherProps}= props;
|
|
49
49
|
const [form] = useState(props.form);
|
|
50
50
|
const page = usePagination({service,pagination,...otherProps})
|
|
51
51
|
|
|
@@ -58,8 +58,14 @@ const usePaginationWithForm = (props) => {
|
|
|
58
58
|
return params;
|
|
59
59
|
};
|
|
60
60
|
page.addListener('beforeService',fnFeforeService);
|
|
61
|
+
for(let fn of beforeService){
|
|
62
|
+
page.addListener('beforeService',fn);
|
|
63
|
+
}
|
|
61
64
|
return ()=>{
|
|
62
65
|
page.removeListener('beforeService',fnFeforeService);
|
|
66
|
+
for(let fn of beforeService){
|
|
67
|
+
page.removeListener('beforeService',fn);
|
|
68
|
+
}
|
|
63
69
|
}
|
|
64
70
|
},[])
|
|
65
71
|
|