DEV Community

Discussion on: JavaScript - Strategy pattern 🧠

Collapse
 
halbano profile image
halbano

Nice article Emi!
I tipically use the same approach for picking the right component based in conditions working with React and React Native too. Despite this would be not as aligned as your use case with the "strategy" term, the usage improves from my point of view readability and clarity.

Collapse
 
emi_castellano profile image
Emi Castellano

Thanks dude, yeah that’s also a good scenario to take advantage of this pattern and increase code readability. 😁