News for hackers. Stuff that matters.
Re:Build Yourself a Redux by acemarke on Friday May 05, 2017 @02:23PM (#14275640)
Dan Abramov has said that the Redux docs were written in a deliberately verbose style to get across the ideas, and he didn't really expect people to strictly imitate that style. There's a wide variety of approaches and utilities you can use to abstract things as much as you'd like - that's entirely up to you.
Re:Build Yourself a Redux by antoaravinth on Saturday May 06, 2017 @01:05PM (#14281196)
As a beginner in Redux, can you tell me about the other ways to handle these boilerplate?
Re:Build Yourself a Redux by acemarke on Monday May 08, 2017 @08:13PM (#14296722)
A few possible options:

- Put all the action types, action types, and reducers for a given portion of the application into one file. This is known as the "ducks" structure, per https://github.com/erikras/ducks-modular-redux .

- Use a utility library like https://github.com/acdlite/redux-actions to generate action types and action creators for you

- Write middleware to manage common logic for your application such as API calls

- Skip writing action creators and declaring action constants, and just have components do `this.props.dispatch({type : "SOME_ACTION"})`.

I don't recommend the last approach, but it's _totally_ up to you, especially because what you regard as "too much boilerplate" is going to be a personal opinion. One person's "too much boilerplate" is another person's "explicit and easy to trace through the system".