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: enable eslint rule @ngrx/prefer-concat-latest-from #1520

Merged
merged 1 commit into from
Oct 30, 2023

Conversation

SGrueber
Copy link
Collaborator

@SGrueber SGrueber commented Oct 16, 2023

PR Type

[ ] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[x] Refactoring (no functional changes, no API changes)
[ ] Build-related changes
[ ] CI-related changes
[ ] Documentation content changes
[ ] Application / infrastructure changes
[ ] Other:

What Is the Current Behavior?

Issue Number: Closes #

What Is the New Behavior?

Find more information here: https://ngrx.io/guide/eslint-plugin/rules/prefer-concat-latest-from

Does this PR Introduce a Breaking Change?

[ ] Yes
[x] No

Other Information

AB#90176

@SGrueber SGrueber requested a review from Eisie96 October 16, 2023 10:31
@SGrueber SGrueber self-assigned this Oct 16, 2023
@SGrueber SGrueber added the refactoring Refactoring of current code label Oct 16, 2023
@SGrueber SGrueber added this to the 5.0 milestone Oct 16, 2023
@SGrueber SGrueber force-pushed the refactor/add_ngrx_eslint_rules branch from b6a5e29 to e44e320 Compare October 23, 2023 15:58
@@ -309,7 +309,7 @@ export class BasketEffects {
loadOrMergeBasketAfterLogin$ = createEffect(() =>
this.actions$.pipe(
ofType(loginUserSuccess),
withLatestFrom(this.anonymousBasket$),
concatLatestFrom(() => this.anonymousBasket$),
Copy link
Contributor

Choose a reason for hiding this comment

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

The adavantage to use 'concatLatestFrom' to subscribe to the inner observable only when the source emits cannot be used here. 'anonymousBasket' is a effect which subscribes to its definition regardless of the wrapped operator.

@SGrueber SGrueber merged commit fc17144 into develop Oct 30, 2023
21 checks passed
@SGrueber SGrueber deleted the refactor/add_ngrx_eslint_rules branch October 30, 2023 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactoring of current code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants