News for hackers. Stuff that matters.
Re:Build Your Own React by acemarke on Thursday November 14, 2019 @02:44PM (#21538654)
Yep. The Redux core `createStore` function can be distilled down to about 25 lines [0], and the rest of the core lib can be added in another 75-ish [1].

I've seen Redux described as "a pattern with really good documentation", and there's some truth to that. On the other hand, we've put a _lot_ of work into React-Redux in particular [2] to make sure it's optimized and works well with React.

As a side note, we have a new official Redux Toolkit package [3] that is our recommended approach for writing Redux logic. It includes utilities to simplify several common Redux use cases, including store setup, defining reducers, immutable update logic, and even creating entire "slices" of state at once.

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

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

[2] https://blog.isquaredsoftware.com/2018/11/react-redux-histor...

[3] https://redux-toolkit.js.org

There are no comments on this comment yet.