5 ms·
This was such a common pattern that reagent created a macro for it. But I like the macro-less code, in that it becomes very clear what is happening. A good macr
by wildermuthn 8y ago
This was such a common pattern that reagent created a macro for it. But I like the macro-less code, in that it becomes very clear what is happening. A good macro reduces complexity by making code concisely simple. A bad macro hides complexity by making code easy to write.
Frameworks like React succeed when they are built like a good macro.
In this case, React is both hiding complexity (component lifecycles) while adding unnecessary complexity (a lInter that will inevitably fail). It’s odd to see React make this move, but not surprising considering that it now has a larger use-base then ever before.
- emmanueloga_ 8y agoAre you maybe talking about with-let? I'm fairly new to reagent and not really familiar with any of its macros As it turns, there are only 5 macros, and only a some of those seem to be part of the public API, which is how I found about `with-let` :-) https://github.com/reagent-project/reagent/search?q=defmacro&unscoped_q=defmacro https://github.com/reagent-project/reagent/search?q=defmacro...