V
V
Vladimir Golub2022-02-20 11:24:15
React
Vladimir Golub, 2022-02-20 11:24:15

Is there any point in using redux-saga now if there is async/await?

redux-saga hasn't been updated since 2019.

Does it make sense to use it in 2022 if there is async/await?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Michael, 2022-02-20
@Akela_wolf

redux-saga is a redux middleware that provides asynchronous processing.
If you want to write similar middleware on your own (considering that Redux itself cannot write asynchronous code and in any case you will need some kind of middleware) - no one can forbid you to do this.
In general, the correct architecture here looks something like it was done in MVICore (framework for Kotlin):
(Action + State) -> actor -> (Effect(s) + State) -> reducer -> State
The first part (actor) works asynchronously and generates effects (maybe none, maybe several). The second part (reducer) works synchronously and generates state changes. Redux provides only the work of the reducer, offering the first part to be implemented by some kind of middleware, self-written or library. So, the presence of async / await in the language does not solve this Redux problem.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question