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

Answer:8 Angular pure pipe #1107

Closed
wants to merge 4 commits into from

Conversation

gitmbints
Copy link

Hello guys,

I hope you're all doing well. I’ve been working on the challenge n°8 (pure pipe), and I would greatly appreciate it if someone could take a moment to review my code.

Your feedback is invaluable, and I'm open to any suggestions or improvements.

Thank you in advance for your time and assistance!

Best regards,

Ambinintsoa

@github-actions github-actions bot added 8 exercice simple pipe answer answer labels Sep 3, 2024
})
export class HeavyComputation implements PipeTransform {
transform(value: string, index: number): string {
return `${value} - ${index}`;

Choose a reason for hiding this comment

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

Just to be on the safer side - can we add a null check here? Everything else is great!

Something like:

transform(name: string | null | undefined, index: number | null | undefined): string {
    if (name == null || index == null) {
      return '';
    }
    
    return `${name} - ${index}`;
  }

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for the review @srikarphanikumar.

Copy link

This pull request is stale because it has been open for 15 days with no activity.

@github-actions github-actions bot added stale and removed stale labels Sep 25, 2024
Copy link

This pull request is stale because it has been open for 15 days with no activity.

@github-actions github-actions bot added the stale label Oct 17, 2024
Copy link

This pull request was closed because it has been inactive for 5 days since being marked as stale.

@github-actions github-actions bot closed this Oct 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8 exercice simple pipe answer answer stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants