-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
feat: challenge 48 Pipe alternative #711
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
feat: challenge 48 Pipe alternative #711
Conversation
…venson95/angular-challenges into add-challenge-pipe-alternative
|
Hey @svenson95, I can see you are back to a new challenge. I'll look more in-depth tomorrow but warning, memo is useless now that computed is present. So I won't create a challenge on this utility function. The article of enea is great but deprecated |
|
Okay, we could also mention that since v17 with computed this memo approach is unnecessary. But maybe for some people, who have to work with angular below v17, this can be useful to know. |
|
This article and this article could be of interest. Few thoughts if you want to rework the concept of the challenge:
|
|
I'm sorry @svenson95, but I don't see the benefits of this challenge. There is no real added value and people should focus on using Pipe instead of useMemo. I like the idea of @jdegand about the computed function with a ternary inside. Or maybe create a challenge where we need to use the untrack function. What do you think? |
|
No problem at all. That's why i first started only the article but not the challenge. I wasn't sure if that's a good challenge, it was just interesting for me. Challenges about signals sounds more interesting though, so i'll work on that. This PR can be closed, i will open up a new one. |
Here is a new proposal for a challenge. For me it's a interesting topic and after the pipe challenges, i delved a little bit deeper into the topic. So i found this article about It’s ok to use function calls in Angular templates and tried it out myself. In my opinion this is a nice extension to the
@Pipe()challenges.This is a first draft, so be encouraged to suppose changes or ideas for the challenge project. My initial idea is to prepare a function - to format a date - which is called in the template. The goal of the challenge would be refactor this function with a
memofunction.I'm also thinking about whether I should somehow display in the UI how often the function or pipe is called - before and after. For example, by creating an element each time the function is called and putting it into an array. To visualize the improvement.