Skip to content

Commit 24ea2b0

Browse files
committed
Clarify behavior when 'initialValue' is set.
1 parent 9e7dac7 commit 24ea2b0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,12 @@ Re-runs the `promiseFn` when this callback returns truthy (called on every updat
491491

492492
> `any | Error`
493493
494-
Initial state for `data` or `error` (if instance of Error); useful for server-side rendering.
494+
Initial state for `data` or `error` (if instance of Error); useful for server-side rendering. When an `initialValue` is
495+
provided, the `promiseFn` will not be invoked on first render. Instead, `status` will be immediately set to `fulfilled`
496+
or `rejected` and your components will render accordingly. If you want to trigger the `promiseFn` regardless, you can
497+
call `reload()` or use the `watch` or `watchFn` option.
498+
499+
> Note that `onResolve` or `onReject` is not invoked in this case and no `promise` prop will be created.
495500
496501
#### `onResolve`
497502

0 commit comments

Comments
 (0)