Skip to content

Commit 1b509b7

Browse files
committed
feat: set useFetch promise$ initData
1 parent ac20114 commit 1b509b7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/core/useFetch/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function useFetch<T>(
126126
payload: undefined as unknown,
127127
};
128128

129-
const promise$ = $<T>();
129+
const promise$ = $<T>(fetchOptions?.initialData);
130130

131131
const {
132132
fetch = window?.fetch,

packages/core/useFetch/type.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ export interface UseFetchReturn<T> {
197197
/**
198198
* promise stream
199199
*/
200-
promise$: Stream<T>;
200+
promise$: Stream<T | undefined, true>;
201201

202202
/**
203203
* Manually call the fetch

0 commit comments

Comments
 (0)