TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

React, Automatic Redux Providers, and Replicators

5 pointsby tfbover 9 years ago

2 comments

tfbover 9 years ago
There seem to be a lot of similar questions about how to reduce redux&#x27;s boilerplate and build something real-world with it. I think I found a pretty good solution (among other things) which I wrote about within this article.<p>TL;DR: You can create redux providers that automatically match themselves to your components based on their propTypes. All you really need is a components directory, a providers directory, and an optional but recommended themes directory. Everything is easily interchangeable, understandable, maintainable, extendable, and reusable. There&#x27;s a lot more included with all that like hot reloading both client and server, server rendering, etc., etc., etc. I built an app from scratch based on the included boilerplate yesterday and it took about 10 minutes as opposed to the 1 hour it would usually take!
ivan_ahover 9 years ago
Very interesting write-up. Definitely cuts down on the boilerplate.<p>Would be good to explain what `react-redux-provide` does under the hood. It might help convince redux users that the package is doing some of the work for them.<p>Also what would the code look like without the @provide decorator? [Stick to ES6, it&#x27;s already crazy enough, no need to jump to ES7 stuff]
评论 #11099222 未加载