Visitar URL original
docs: clarify streaming resource data flow · angular/angular@3c7e05c · GitHub
Skip to content

Commit 3c7e05c

Browse files
joaodemarcojoaodemarco-camp
authored andcommitted
docs: clarify streaming resource data flow
1 parent 813e90f commit 3c7e05c

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

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

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

6262
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` for these continuously updating data sources. Unlike `loader`, which resolves once for each request, `stream` should return a signal representing a continuously updating data source. The resource uses the signal's value as its current value and updates when the signal changes.
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

6666
Use `loader` for one-time asynchronous operations, such as fetching data from an HTTP endpoint.
6767

68-
In this example, `userUpdates` simulates an external source such as a WebSocket or SSE connection. The resource reads the signal's value and updates its own value whenever the signal changes.
68+
In this example, `userUpdates` simulates an external source such as a WebSocket or SSE connection.
6969

7070
```typescript
7171
const userUpdates = signal({value: 'Alice'});

0 commit comments

Comments
 (0)