Hacker News new | ask | show | jobs
by SilverSlash 2808 days ago
Hi, I've not actually used redux at any scale but I have used react a lot (sounds silly?).

I was wondering, would it be possible to have something like a strict subset of redux with minimal boilerplate and very few and very simple API functions which are redux compatible. But which can eventually be swapped with the full Redux library if need be?

1 comments

No, not really. Redux itself _is_ already small - if you strip out the safety checks, it's less than 100 lines [0], and you can see the core concept in less than 25 [1].

Part of the issue is that people use the word "boilerplate" to refer to many different things, such as writing action creator functions, writing immutable update logic, calling `connect()` to generate wrapper components that talk to the Redux store, etc. Everyone seems to have a different thing that they are concerned about.

The "starter kit" package I linked tries to address several of the most common concerns, while still keeping Redux the way it's meant to be used.

[0] https://gist.github.com/gaearon/ffd88b0e4f00b22c3159

[1] https://blog.isquaredsoftware.com/2017/05/idiomatic-redux-ta...