Redux Toolkit With Typescript: How to Get Started

If you're a React developer, chances are you already know how complicated it can get when working with global/shared states. Nonetheless, nowadays, there are two main ways to use this concept: 

  • Redux
  • Context API.

It is essential to highlight that a learning curve is necessary to use both of these approaches in the best way possible. This view is based on the fact that its high complexity and verbosity come into focus whenever Redux is mentioned. This is even more pronounced when it comes to using Redux with Typescript.

How to Connect Your React Application With Redux

An exciting adventure for React developers is when they connect their React application with redux and when you have made it this far in reading about React, that means you are on the way to explore the out of the box concept of how you can manage global states in your application. This article will be helpful for React developers in integrating React applications with Redux.

Though React gives us the ability to manage state for our components, the dependency of the parent components on the child components and state management between two components becomes complicated with the increasing size of the application. To resolve this issue we have a third-party library called Redux which gives us all these wonderful features we need for global state management. Read Further at React Application with Redux.

How to Implement Data Polling With React, Redux, and Thunk

Introduction

In my previous article, Loading Data in React: Redux-Thunk, Redux-Saga, Suspense, and HooksI compared different ways of loading data from the API. Quite often in web applications, data needs to be updated frequently to show relevant information to the user. Short polling is one of the ways to do it. Check out this article for more details and alternatives.

Briefly, we are going to ask for new data every N milliseconds. We then show this new data instead of the previously loaded data. This article gives an example of how to do it using React, Redux, and Thunk.

Loading Data in React: Redux-Thunk, Redux-Saga, Suspense, and Hooks

Introduction

React is a JavaScript library for building user interfaces. Very often using React means using React with Redux. Redux is another JavaScript library for managing global state. Sadly, even with these two libraries, there is no one clear way to handle asynchronous calls to the API (backend) or any other side effects.

In this article, I’m trying to compare different approaches to solving this problem. Let’s define the problem first.