Redux Middleware- The differences between Redux-thunk and Redux-saga

Jen-Hsuan Hsieh (Sean)
A Layman
Published in
5 min readSep 6, 2020

--

Introduction

In redux, we always need middleware to help us to handle the asynchronous operations or other side effects.

The most popular middlewares are Redux-thunk and Redux-saga.

source: https://www.npmjs.com/

This topic notes the differences between Redux-thunk and Redux-saga for using. We will discuss the following items.

  • Overview
  • Concepts
  • Roles and usages
  • Libraries
  • Implementations

Overview

Definitions

Redux Thunk middleware allows you to write action creators that return a function instead of an action. The thunk can be used to delay the dispatch of an action, or to dispatch only if a certain condition is met.

redux-saga is a library that aims to make application side effects (i.e. asynchronous things like data fetching and impure things like…

--

--

Jen-Hsuan Hsieh (Sean)
A Layman

Frontend Developer🚀 Angular • React • Nest • Electron • Micro-frontend • Monorepo Architecture • https://daily-learning.herokuapp.com/