Skip to content

Commit f29da63

Browse files
crisbetommalerba
authored andcommitted
feat: update to rxjs 5.5.0 and switch to lettable operators (#7276)
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 62b149f commit f29da63

Some content is hidden

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

50 files changed

+8913
-7292
lines changed

.github/CODEOWNERS

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
/src/cdk/overlay/** @jelbourn @crisbeto
6464
/src/cdk/platform/** @jelbourn @devversion
6565
/src/cdk/portal/** @jelbourn
66-
/src/cdk/rxjs/** @jelbourn
6766
/src/cdk/scrolling/** @andrewseguin @crisbeto
6867
/src/cdk/stepper/** @mmalerba
6968
/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)