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

Feature/cxspa 4110 quote cart #17687

Closed

Conversation

ChristophHi
Copy link
Contributor

No description provided.

@cla-assistant
Copy link

cla-assistant bot commented Jul 28, 2023

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
1 out of 2 committers have signed the CLA.

✅ ChristophHi
❌ github-actions[bot]
You have signed the CLA already but the status is still pending? Let us recheck it.

: list;
if (order) {
//deep copy order list
const clonedActionList = order.map((actionType) => actionType);
Copy link
Contributor

Choose a reason for hiding this comment

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

'minor': consider using the new global method structuredClone that has been introduced for deep copying.
For more, see: https://developer.mozilla.org/en-US/docs/Web/API/structuredClone

@Component({
templateUrl: './quote-aware.component.html',
})
export class QuoteAwareComponent {}
Copy link
Contributor

Choose a reason for hiding this comment

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

query: Can you remind me what was the idea behind this component and related logic?

@Injectable({
providedIn: 'root',
})
export class QuoteCartService {
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: I propose creating a ticket about removing this service once the backend is ready and adding comments with the ticket number to all related places. It may be useful in terms of tracking and refactoring.

})
export class QuoteCartService {
private quoteId: Observable<string> = new ReplaySubject<string>(1);
private quoteCartActive: Observable<boolean> = new ReplaySubject<boolean>(1);
Copy link
Contributor

Choose a reason for hiding this comment

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

minor: Instead of casting this field each time you want to use ReplaySubject methods, I propose reversed approach - keep the ReplaySubject type and update the stream each time you need, but when you want some method returns an observable that can't be modified, use asObservable:

private quoteCartActive = new ReplaySubject<boolean>(1);

 [...]

 public setQuoteId(quoteId: string): void {
    this.quoteId.next(quoteId);
  }

  public getQuoteId(): Observable<string> {
    return this.quoteId.asObservable();
  }

@pawelfras pawelfras marked this pull request as ready for review August 1, 2023 11:27
@pawelfras pawelfras requested a review from a team as a code owner August 1, 2023 11:27
@pawelfras pawelfras requested a review from a team August 1, 2023 11:27
@pawelfras pawelfras requested review from a team as code owners August 1, 2023 11:27
@ChristophHi
Copy link
Contributor Author

Instead I have merged #17721 which is based on this one

@ChristophHi ChristophHi closed this Aug 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants