-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Conversation
…into angular-pure-pipe
…lar-challenges into angular-pure-pipe
}) | ||
export class HeavyComputation implements PipeTransform { | ||
transform(value: string, index: number): string { | ||
return `${value} - ${index}`; |
There was a problem hiding this comment.
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}`;
}
There was a problem hiding this comment.
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.
This pull request is stale because it has been open for 15 days with no activity. |
This pull request is stale because it has been open for 15 days with no activity. |
This pull request was closed because it has been inactive for 5 days since being marked as stale. |
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