Skip to content

Commit c640efa

Browse files
author
Andrey Evstratov
committed
set initial loading state from options fields
1 parent 4da03c6 commit c640efa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/runed/src/lib/utilities/resource/resource.svelte.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ function runResource<
150150

151151
// Create state
152152
let current = $state<Awaited<ReturnType<Fetcher>> | undefined>(initialValue);
153-
let loading = $state(false);
153+
let loading = $state(initialValue === undefined && !lazy);
154154
let error = $state<Error | undefined>(undefined);
155155
let cleanupFns = $state<Array<() => void>>([]);
156156

0 commit comments

Comments
 (0)