Best practices

So far, we have gone through a lot. We have covered principles, core concepts, and even got to build our own Redux implementation. We should be mighty proud of ourselves at this point. There is something we have yet to cover, though, and that is how we use Redux in an optimal way. There are some key rules we can follow.

Organize your file system optimally. You should not have a few files when building an app but rather many, and usually organized by feature. This leads to the following file setup for a feature:

  • Reducer: We should have one file, per reducer, for this
  • Actions: We should have a file describing all the actions we could possibly dispatch
  • View/component file: This has nothing to do with Redux but, regardless of ...

Get Architecting Angular Applications with Redux, RxJS, and NgRx now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.