You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Loads the resource from the provided URL. Two overloads are available:
50
51
51
-
***url**: The URL from which the resource should be loaded. If `null` is provided the resource is reset to its initial value.
52
-
***fromCache**: Whether to load the resource even if the the current state is loaded from the same URL. If not provided, defaults to `false`.
52
+
* When called with a **plain value** (`string | null`): loads the resource immediately and returns a `Promise<void>` that resolves when the request completes. Passing `null` resets the resource to its initial value.
53
+
***fromCache**: When `true`, skips loading if the resource is already loaded from the same URL. Defaults to `false`.
54
+
* When called with a **`Signal<string | null>`**: sets up a reactive effect that automatically reloads the resource whenever the signal's value changes, and returns an `EffectRef` that can be used to destroy the effect.
53
55
54
56
### Load the Resource from a Link
55
57
```ts
@@ -65,11 +67,3 @@ Loads the resource from the provided URL.
Reactively connects the resource to a URL signal. Whenever the signal emits a new URL value, the resource is automatically loaded from that URL. If a plain `string` is passed instead of a signal, the resource is loaded once from that URL.
74
-
75
-
***url**: A `Signal<string>` whose value is used as the URL. Whenever the signal changes, the resource is reloaded automatically. Can also be a plain `string` for a one-time load.
Loads the resource from the provided URL. Two overloads are available:
55
56
56
-
***url**: The URL from which the resource should be loaded. If `null` is provided the resource is reset to its initial value.
57
-
***fromCache**: Whether to load the resource even if the the current state is loaded from the same URL. If not provided, defaults to `false`.
57
+
* When called with a **plain value** (`string | null`): loads the resource immediately and returns a `Promise<void>` that resolves when the request completes. Passing `null` resets the resource to its initial value.
58
+
***fromCache**: When `true`, skips loading if the resource is already loaded from the same URL. Defaults to `false`.
59
+
* When called with a **`Signal<string | null>`**: sets up a reactive effect that automatically reloads the resource whenever the signal's value changes, and returns an `EffectRef` that can be used to destroy the effect.
58
60
59
61
### Load the Resource from a Link
60
62
```ts
@@ -69,12 +71,4 @@ Loads the resource from the provided URL.
Reactively connects the resource to a URL signal. Whenever the signal emits a new URL value, the resource is automatically loaded from that URL. If a plain `string` is passed instead of a signal, the resource is loaded once from that URL.
79
-
80
-
***url**: A `Signal<string>` whose value is used as the URL. Whenever the signal changes, the resource is reloaded automatically. Can also be a plain `string` for a one-time load.
0 commit comments