I hate react-redux boilerplate code and NgRx boilerplate codes too. How to avoid boilerplate code or minimize it?

I've heard about zustand but it is quite new. Legacy apps mostly use react-redux with lots of boilerplate codes.

  • 0
    There is hardly any boilerplate code for redux?
  • 0
    @wiwe2210 yes there are boilerplate code s when setting up react-redux. Actions and reducers. I was looking if it can be simplified to write less boilerplate codes.
  • 1
    If you are setting up redux its best you orientate on the suggestions made in the docs and use redux-toolkit.

    This gives you a useful store config and you have immer.js and thunk directly set up. Its as easy as copy pasting 20 lines of code. The boilerplate, as well as your reducers are reduced to an absolute minimum.
  • 0
    @Devnergy van write those any way you see fit
  • 0
    @vigidis well if you work on legacy apps then you don't have that freedom to select.
Add Comment