Front-end developer
JavaScript. Predominately react & redux. A bit of NodeJS, small amount of PHP.
Chasing FIRE.
Building Albert (https://www.albertrm.com)
Thanks for the interesting comment - I actually wasn't aware of the new object shorthand. That looks really interesting.
I'd be curious to hear your thoughts more about why it matters if the component is 'aware' of redux. I would say the main reason we use the props.actions object is just for consistency and tidiness.
Thing is, the "object shorthand" isn't new at all - it's been there since day 1 :) See react-redux issue #1 for early discussion. It's even in the existing API docs, but it's kinda buried in there, and you have to squint hard at the right paragraph to understand it.
The "awareness" thing is mostly a general principle. I think it's worth trying to keep most components generic and reusable in the sense that they shouldn't care where their props are coming from. It's not always achievable, but it's a useful long-term architectural objective.
Front-end developer
JavaScript. Predominately react & redux. A bit of NodeJS, small amount of PHP.
Chasing FIRE.
Building Albert (https://www.albertrm.com)
Hey Mark,
Thanks for the interesting comment - I actually wasn't aware of the new object shorthand. That looks really interesting.
I'd be curious to hear your thoughts more about why it matters if the component is 'aware' of redux. I would say the main reason we use the
props.actions
object is just for consistency and tidiness.Cheers for engaging, I appreciate it!
Thing is, the "object shorthand" isn't new at all - it's been there since day 1 :) See react-redux issue #1 for early discussion. It's even in the existing API docs, but it's kinda buried in there, and you have to squint hard at the right paragraph to understand it.
The "awareness" thing is mostly a general principle. I think it's worth trying to keep most components generic and reusable in the sense that they shouldn't care where their props are coming from. It's not always achievable, but it's a useful long-term architectural objective.
Well, you learn something new every day!
Thanks for the insight, Mark!