Skip to content
New issue

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

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

Already on GitHub? # to your account

chore: update docs app to Angular v15 #7238

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jakovljevic-mladen
Copy link
Member

Description:
Update docs app to Angular v15

Related issue (if exists):
None

Comment on lines +31 to 33
this.location.subscribe((state) => {
return this.urlSubject.next(state.url || '');
});
Copy link

Choose a reason for hiding this comment

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

Suggested change
this.location.subscribe((state) => {
return this.urlSubject.next(state.url || '');
});
this.location.subscribe((state) => return this.urlSubject.next(state.url ?? ''));

Copy link
Contributor

Choose a reason for hiding this comment

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

@LcsGa Did you mean this?

Suggested change
this.location.subscribe((state) => {
return this.urlSubject.next(state.url || '');
});
this.location.subscribe((state) => this.urlSubject.next(state.url || ''));

Copy link

Choose a reason for hiding this comment

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

Oh indeed! Forget to remove the return keyboard plus I would have used the nullish coalescing operator ?? instead of ||

const search = Object.keys(params).reduce((acc, key) => {
const value = params[key];
return (value === undefined) ? acc :
acc += (acc ? '&' : '?') + `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
return value === undefined ? acc : (acc += (acc ? '&' : '?') + `${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
Copy link

Choose a reason for hiding this comment

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

Suggested change
return value === undefined ? acc : (acc += (acc ? '&' : '?') + `${encodeURIComponent(key)}=${encodeURIComponent(value)}`);
return value === undefined ? acc : (acc + (acc ? '&' : '?') + `${encodeURIComponent(key)}=${encodeURIComponent(value)}`);

= is not needed since you already return the result which will be the new acc

Copy link
Member Author

Choose a reason for hiding this comment

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

Which needs to become new acc, therefore it is needed 🙂

Anyways, I didn't change anything in this PR, a lot of fixes here are just Prettier uglifying things (I don't like Prettier), therefore, if it worked before, I wouldn't change it now.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants