fix: merge errors
This commit is contained in:
@@ -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]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user