feat: pagination in nav

This commit is contained in:
Wentao Lyu 2023-03-15 04:05:14 +08:00
parent 71fc86b9a6
commit 8289558d94
8 changed files with 84 additions and 46 deletions

View file

@ -9,14 +9,14 @@ const postRequest = async (url, { arg }) => {
return await axios.post(url, { arg });
};
export const swr = (path, successCallback) => {
const options = {};
export const swr = (path, successCallback, options) => {
const _options = {...options};
if (successCallback) {
options.onSuccess = successCallback;
_options.onSuccess = successCallback;
}
return useSWR(path, fetcher, options);
return useSWR(path, fetcher, _options);
}
export default function manualSWR(path, type, successCallback) {