Skip to content

Commit 9142712

Browse files
BHUVANSH855alxhub
authored andcommitted
docs: reorder streaming resources description
1 parent 9c9ead9 commit 9142712

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎adev/src/content/guide/signals/resource.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@ If the `params` computation returns `undefined`, the loader function does not ru
5959

6060
### Streaming resources
6161

62-
Use `loader` when a resource performs a single asynchronous operation, such as fetching data from an HTTP endpoint.
62+
Some asynchronous data sources produce multiple values over time instead of returning a single result. Examples include WebSockets, Server-Sent Events (SSE), and Firestore `onSnapshot` listeners.
6363

64-
Use `stream` when your data source can emit multiple values over time. Unlike `loader`, which resolves once for each request, `stream` returns a signal whose value can continue to update as new data becomes available.
64+
Use `stream` for these continuously updating data sources. Unlike `loader`, which resolves once for each request, `stream` returns a signal whose value can continue to update as new data becomes available.
6565

66-
Streaming resources are useful for continuously updating data sources such as WebSockets, Server-Sent Events (SSE), or Firestore `onSnapshot` listeners.
66+
Use `loader` for one-time asynchronous operations, such as fetching data from an HTTP endpoint.
6767

6868
```typescript
6969
const userUpdates = signal({value: 'Alice'});

0 commit comments

Comments
 (0)