Skip to content

Commit 2cd7e4d

Browse files
committed
feat: update to rxjs 5.5.0 and switch to lettable operators
Bumps the required RxJS version to 5.5.0 and gets rid of our RxChain in favor of using the lettable Rx operators. Refactors all the usages and updates the configs. Fixes #7275.
1 parent 0ea4370 commit 2cd7e4d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1704
-1948
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
/src/cdk/overlay/** @jelbourn @crisbeto
6565
/src/cdk/platform/** @jelbourn @devversion
6666
/src/cdk/portal/** @jelbourn
67-
/src/cdk/rxjs/** @jelbourn
6867
/src/cdk/scrolling/** @andrewseguin @crisbeto
6968
/src/cdk/stepper/** @mmalerba
7069
/src/cdk/table/** @andrewseguin

CODING_STANDARDS.md

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -127,33 +127,20 @@ class ConfigBuilder {
127127
```
128128

129129
#### RxJS
130-
When dealing with RxJS operators, import the operator functions directly (e.g.
131-
`import "rxjs/operator/map"`), as opposed to using the "patch" imports which pollute the user's
132-
global Observable object (e.g. `import "rxjs/add/operator/map"`):
130+
When dealing with RxJS operators, import the lettable operator (e.g.
131+
`import {map} from 'rxjs/operators'`), as opposed to using the "patch" imports which pollute the
132+
user's global Observable object (e.g. `import 'rxjs/add/operator/map'`):
133133

134134
```ts
135135
// NO
136136
import 'rxjs/add/operator/map';
137137
someObservable.map(...).subscribe(...);
138138

139139
// YES
140-
import {map} from 'rxjs/operator/map';
141-
map.call(someObservable, ...).subscribe(...);
140+
import {map} from 'rxjs/operators';
141+
someObservable.pipe(map(...)).subscribe(...);
142142
```
143143

144-
Note that this approach can be inflexible when dealing with long chains of operators. You can use
145-
the `RxChain` class to help with it:
146-
147-
```ts
148-
// Before
149-
someObservable.filter(...).map(...).do(...);
150-
151-
// After
152-
RxChain.from(someObservable).call(filter, ...).call(map, ...).call(do, ...).subscribe(...);
153-
```
154-
Note that not all operators are available via the `RxChain`. If the operator that you need isn't
155-
declared, you can add it to `/core/rxjs/rx-operators.ts`.
156-
157144
#### Access modifiers
158145
* Omit the `public` keyword as it is the default behavior.
159146
* Use `private` when appropriate and possible, prefixing the name with an underscore.

0 commit comments

Comments
 (0)