fix: merge errors

This commit is contained in:
Koosha Lahouti
2025-08-16 11:47:08 +03:30
parent f7207b8545
commit 8e016dd419
5 changed files with 1 additions and 412 deletions

View File

@@ -56,8 +56,7 @@ export function useApi<T, P extends any[]>(
// If the 'immediate' option is true, execute the function on mount
useEffect(() => {
if (options.immediate) {
// We pass undefined as params for the initial call.
execute(...(undefined as unknown as P));
execute(...([] as unknown as P)); // safe default: no args
}
}, [execute, options.immediate]);