Skip to content
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

refactor: remove rxjs patch operators in favor of lettable operators #8548

Merged
merged 1 commit into from
Nov 21, 2017

Conversation

CaerusKaru
Copy link
Member

@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Nov 19, 2017
return merge(...displayDataChanges)
.pipe(
map(() => {
return this.getSortedData();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be turned to one-line.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

.map(user => user && typeof user === 'object' ? user.name : user)
.map(name => name ? this.filter(name) : this.options.slice());
.pipe(
startWith({} as User),
Copy link
Contributor

@rafaelss95 rafaelss95 Nov 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason to change from null to {} as User? (Here and elsewhere).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having it stay as null breaks strictNullChecks.

@@ -55,7 +54,7 @@ export class KitchenSink {

/** Data source for the CDK and Material table. */
tableDataSource: DataSource<any> = {
connect: () => Observable.of([
connect: () => of([
Copy link
Contributor

@rafaelss95 rafaelss95 Nov 19, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before, when Material2 imported the rxjs "functions" directly they used to rename the of import like this:

import {of as observableOf} from 'rxjs/observable/of';

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably because of is a keyword in the ES6 for...of syntax. I'll change it just to be safe.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. In fact, I thought rxjs could change this operator name, as they did for (to avoid conflicts):

catch -> catchError
do -> tap
finally -> finalize
switch -> switchAll

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worth filing an issue in the rxjs repo

@CaerusKaru CaerusKaru force-pushed the rxjs-docs branch 3 times, most recently from ab23945 to 0730cc3 Compare November 19, 2017 23:49
@jelbourn
Copy link
Member

@andrewseguin please review

Copy link
Contributor

@andrewseguin andrewseguin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for doing this work. It'll be helpful for people trying to understand how to use pipe in their apps

@andrewseguin andrewseguin added action: merge The PR is ready for merge by the caretaker pr: lgtm labels Nov 21, 2017
@jelbourn jelbourn merged commit 4dd8a31 into angular:master Nov 21, 2017
@CaerusKaru CaerusKaru deleted the rxjs-docs branch November 21, 2017 20:07
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change rxjs imports in material-examples
5 participants