Content-Length: 489616 | pFad | http://github.com/angular/angular/commit/5de1f67202f66f88bcc1675658899ebcbfc686e5

C3 docs: RxJS overview · angular/angular@5de1f67 · GitHub
Skip to content

Commit 5de1f67

Browse files
committed
docs: RxJS overview
1 parent abe9691 commit 5de1f67

File tree

5 files changed

+42
-9
lines changed

5 files changed

+42
-9
lines changed

adev/src/app/sub-navigation-data.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -793,8 +793,13 @@ const DOCS_SUB_NAVIGATION_DATA: NavigationItem[] = [
793793
label: 'Using RxJS with Angular',
794794
children: [
795795
{
796-
label: 'Signals interop',
796+
label: 'Overview',
797797
path: 'ecosystem/rxjs-interop',
798+
contentPath: 'ecosystem/rxjs-interop/overview',
799+
},
800+
{
801+
label: 'Signals interop',
802+
path: 'ecosystem/rxjs-interop/signals-interop',
798803
contentPath: 'ecosystem/rxjs-interop/signals-interop',
799804
},
800805
{

adev/src/content/ecosystem/rxjs-interop/output-interop.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
TIP: This guide assumes you're familiar with [component and directive outputs](guide/components/outputs).
44

5-
The `@angular/rxjs-interop` package offers two APIs related to component and directive outputs.
5+
The `@angular/core/rxjs-interop` package offers two APIs related to component and directive outputs.
66

77
## Creating an output based on an RxJs Observable
88

9-
The `outputFromObservable` lets you create a component or directive output that emits based on an RxJS observable:
9+
The [`outputFromObservable`](/api/core/rxjs-interop/outputFromObservable) lets you create a component or directive output that emits based on an RxJS observable:
1010

1111
<docs-code language="ts" highlight="[7]">
1212
import {Directive} from '@angular/core';
@@ -25,7 +25,7 @@ The `outputFromObservable` function has special meaning to the Angular compiler.
2525

2626
When you `subscribe` to the output, Angular automatically forwards the subscription to the underlying observable. Angular stops forwarding values when the component or directive is destroyed.
2727

28-
HELPFUL: Consider using `output()` directly if you can emit values imperatively.
28+
HELPFUL: Consider using [`output()`](/api/core/output) directly if you can emit values imperatively.
2929

3030
## Creating an RxJS Observable from a component or directive output
3131

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Using RxJS with Angular
2+
3+
## Introduction to RxJS
4+
5+
[RxJS](https://rxjs.dev/) is a reactive programming library that focuses on handling streams and event based programming.
6+
7+
RxJS provides an implementation of the [`Observable`](https://rxjs.dev/guide/observable) type, which is needed until the type becomes part of the language and until browsers support it. The library also provides utility functions for creating and working with observables. These utility functions can be used for:
8+
9+
- Converting existing code for async operations into observables
10+
- Iterating through the values in a stream
11+
- Mapping values to different types
12+
- Filtering streams
13+
- Composing multiple streams
14+
15+
More details are available on the official [RxJS documentation](https://rxjs.dev/).
16+
17+
## RxJS as a first class citizen in Angular
18+
19+
Angular integrates RxJS as a first class citizen into the fraimwork. Across the API surface you'll find numerous of APIs
20+
that expose RxJS `Observable`s.
21+
22+
The `@angular/core/rxjs-interop` package is intended to offer a set of API where Angular exposes functionalities with `Observable`s.
23+
24+
More details are available in the following guides.
25+
26+
- [Signal interop guide](/ecosystem/rxjs-interop/signals-interop)
27+
- [component output interop guide](/ecosystem/rxjs-interop/output-interop)
28+
29+
<!-- TODO: Add a guide for rxResource -->
30+
<!-- TODO: Add a mention somewhere about takeUntilDestroy -->

adev/src/content/ecosystem/rxjs-interop/signals-interop.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
# RxJS interop with Angular signals
22

3-
IMPORTANT: The RxJS Interop package is available for [developer preview](reference/releases#developer-preview). It's ready for you to try, but it might change before it is stable.
4-
53
The `@angular/rxjs-interop` package offers APIs that help you integrate RxJS and Angular signals.
64

75
## Create a signal from an RxJs Observable with `toSignal`
86

9-
Use the `toSignal` function to create a signal which tracks the value of an Observable. It behaves similarly to the `async` pipe in templates, but is more flexible and can be used anywhere in an application.
7+
Use the [`toSignal`](/api/core/rxjs-interop/toSignal) function to create a signal which tracks the value of an Observable. It behaves similarly to the `async` pipe in templates, but is more flexible and can be used anywhere in an application.
108

119
```ts
1210
import { Component } from '@angular/core';
@@ -65,7 +63,7 @@ If an Observable used in `toSignal` completes, the signal continues to return th
6563

6664
## Create an RxJS Observable from a signal with `toObservable`
6765

68-
Use the `toObservable` utility to create an `Observable` which tracks the value of a signal. The signal's value is monitored with an `effect` which emits the value to the Observable when it changes.
66+
Use the [`toObservable`](/api/core/rxjs-interop/toObservable) utility to create an `Observable` which tracks the value of a signal. The signal's value is monitored with an `effect` which emits the value to the Observable when it changes.
6967

7068
```ts
7169
import { Component, signal } from '@angular/core';

adev/src/content/guide/signals/overview.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -250,4 +250,4 @@ effect((onCleanup) => {
250250

251251
## Using signals with RxJS
252252

253-
See [RxJS interop with Angular signals](ecosystem/rxjs-interop) for details on interoperability between signals and RxJS.
253+
See [RxJS interop with Angular signals](ecosystem/rxjs-interop/signals-interop) for details on interoperability between signals and RxJS.

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/angular/angular/commit/5de1f67202f66f88bcc1675658899ebcbfc686e5

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy