Hey guys, how are you?!
Today I was developing some things and I realized that I was using something very frequently, this is wonderful because as...
For further actions, you may consider blocking this person and/or reporting abuse
In React there are a lot of packages for managing ternary operators for conditionally rendering some UI parts. It's really easy to even create such components by yourself.
I am sure that Angular also can have such approaches. Even if it is hard to find such kind of components I think it's better to move the conditional statement to Component file for making the code cleaner and more readable.
Attaching some packages for React.
npmjs.com/package/react-if
npmjs.com/package/react-conditiona...
P.S. If you wish I can share my own written solution for such kind of problem.
Wow, really cool and interesting. I also like to keep everything well componentized to avoid duplication and make maintenance easier. Thanks for sharing!
Please, I'd love to see your solution!
Pushed the solution to GitHub.
Feel free for any kind of comments.
github.com/alexandermirzoyan/rc-co...
I use list comprension (in python) a whole lot. I used suffix ops to achieve the same in ruby. But I also use the ternary op a lot, and I love it.