Skip to content

feat: update to rxjs 5.5.0 and switch to lettable operators #7276

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 28, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@
/src/cdk/overlay/** @jelbourn @crisbeto
/src/cdk/platform/** @jelbourn @devversion
/src/cdk/portal/** @jelbourn
/src/cdk/rxjs/** @jelbourn
/src/cdk/scrolling/** @andrewseguin @crisbeto
/src/cdk/stepper/** @mmalerba
/src/cdk/table/** @andrewseguin
Expand Down
23 changes: 5 additions & 18 deletions CODING_STANDARDS.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,33 +127,20 @@ class ConfigBuilder {
```

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

```ts
// NO
import 'rxjs/add/operator/map';
someObservable.map(...).subscribe(...);

// YES
import {map} from 'rxjs/operator/map';
map.call(someObservable, ...).subscribe(...);
import {map} from 'rxjs/operators';
someObservable.pipe(map(...)).subscribe(...);
```

Note that this approach can be inflexible when dealing with long chains of operators. You can use
the `RxChain` class to help with it:

```ts
// Before
someObservable.filter(...).map(...).do(...);

// After
RxChain.from(someObservable).call(filter, ...).call(map, ...).call(do, ...).subscribe(...);
```
Note that not all operators are available via the `RxChain`. If the operator that you need isn't
declared, you can add it to `/core/rxjs/rx-operators.ts`.

#### Access modifiers
* Omit the `public` keyword as it is the default behavior.
* Use `private` when appropriate and possible, prefixing the name with an underscore.
Expand Down
Loading