macro add Args passing

This commit is contained in:
honzapatCZ 2025-01-11 23:11:16 +01:00
parent d99fc0e4d8
commit a1e637fead
2 changed files with 2 additions and 2 deletions

View File

@ -120,7 +120,7 @@ const RUN_NAME = USE_CALLBACK(async (...ARGS) => {
CALL_SET({ data: ret, error: null, loading: false });
ON_STOP_LOADING_IDENTIFIER(notifKey);
ON_SUCCESS_IDENTIFIER();
DONE(ret);
DONE(ret, ...ARGS);
return ret;
}
catch(e){

View File

@ -1,5 +1,5 @@
import { CancelablePromise, Error } from "src/services/api";
export default function useMethod<T, Arg>(method: (...args: Arg) => CancelablePromise<T>,
onDone?: (data: T) => void,
onDone?: (data: T, ...args: Arg) => void,
onError?: (error: Error) => void = null): [(...args: Arg) => CancelablePromise<T>, { data: T, loading: boolean, error: Error }];