Redux

The Ultimate Cheat Sheet on Splitting Dynamic Redux Reducers

The Ultimate Cheat Sheet on Splitting Dynamic Redux Reducers

This post is specific to need of code-splitting in React/Redux projects. While exploring the possibility to optimise the application, the common problem occurs with reducers. This article specifically focuses on how do we split reducers to be able to deliver them in chunks.

What are the benefits of splitting reducers in chunks?

1) True code splitting is possible

2) A good architecture can be maintained by keeping page/component level reducers isolated from other parts of application minimising the dependency on other parts of application.

How to Make Asynchronous Calls in Redux Without Middlewares

How to Make Asynchronous Calls in Redux Without Middlewares

Redux has greatly helped in reducing the complexities of state management. Its one way data flow is easier to reason about and it also provides a powerful mechanism to include middlewares which can be chained together to do our biding. One of the most common use case for the middleware is to make async calls in the application. Different middlewares like redux-thunk, redux-sagas, redux-observable, etc are a few examples. All of these come with their own learning curve and are best suited for tackling different scenarios.

But what if our use-case is simple enough and we don’t want to have the added complexities that implementing a middleware brings? Can we somehow implement the most common use-case of making async API calls using only redux and javascript?