Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Jun 12 20:21
    Andarist locked #1860
  • Jun 12 20:21
    Andarist closed #1860
  • Jun 12 19:17
    github-actions[bot] synchronize #2069
  • Jun 12 19:17

    github-actions[bot] on master

    Version Packages (compare)

  • Jun 12 19:17
    github-actions[bot] edited #2069
  • Jun 12 19:16
    Andarist commented #2194
  • Jun 12 19:16

    Andarist on master

    docs: fix broken links (#2194) (compare)

  • Jun 12 19:16
    Andarist closed #2194
  • Jun 12 18:59
    changeset-bot[bot] commented #2194
  • Jun 12 18:59
    brunocechet opened #2194
  • Jun 12 13:32
    panmau commented #2177
  • Jun 11 14:41
    dineshnagrani commented #1860
  • Jun 06 17:19
    changeset-bot[bot] commented #2193
  • Jun 06 17:19

    dependabot[bot] on npm_and_yarn

    Bump ws from 6.2.1 to 6.2.2 in … (compare)

  • Jun 06 17:19
    dependabot[bot] labeled #2193
  • Jun 06 17:19
    dependabot[bot] opened #2193
  • Jun 04 16:44
    MAhtishamShahzad commented #672
  • Jun 04 08:02
    Andarist closed #2192
  • Jun 04 08:02
    Andarist commented #2192
  • Jun 04 06:07
    MAhtishamShahzad opened #2192
Matti Järvinen
Kinda related to @AmyBlankenship ´s question. I'm testing a full saga with runSaga. How would I add another action in there so I can test that it cancels the previous one?
for v1.o, catch not work? const rootTask = sagaMiddleware.run(rootSaga)
anybody know the issue
Aleksander Vognild Burkow
@gilbsgilbs i'm having a look at your dtslint branch
I'm not having any trouble running the tests, and think i might be getting other erors than you described
i get straight-up normal errors:
Error: /Users/aleksandervognildburkow/Projects/redux-saga/packages/core/types/ts3.5/channels.test.ts:24:1
ERROR: 24:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 32:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 45:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 47:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 51:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 56:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 58:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 82:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 90:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 99:1    expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 112:1   expect  TypeScript@next: Expected an error on this line, but found none.
ERROR: 116:1   expect  TypeScript@next: Expected an error on this line, but found none.

In order for the execution exception of an effect to not affect the whole, I created a wrapper function. For example, the following adds safety to each effect, which solves the problem.

But if my effect is very large, it is very time consuming and not elegant to manually increase the safety. I want to know if there is any way, such as a loop function to automatically add safety to each effect, which makes the code more beautiful.

wrapper function

import { call } from 'redux-saga/effects';

export function safe(sagaFn) {
  return function* (action) {
    try {
      return yield call(sagaFn, action);
    } catch (e) {
      console.error('[react-demo | Saga Unhandled Exception] This error should be fixed or do some pre check in saga effects function.');


function* mySaga() {
    yield takeEvery('USER_FETCH', safe(fetchUserEffects));
    yield takeEvery('TEST_SAGA', safe(testSagaEffects));
    yield takeEvery('TEST_SAGA', safe(testSagaEffects2));
Gilbert Gilb's

@aleksanb Just came across your message. Thanks for reaching out! The errors you were pointing out occurred because TS wasn't able to resolve some types and was using any type as a replacement. So this was actually highly related to the issue I had.

As I said in the PR, I finally found a way to debug and fix it and the PR got merged into master :tada: . Unfortunately, it doesn't seem to work on @Andarist machine and he's unable to release, not sure why. If you want to give it a try 🤷‍♂️ .

@Andarist whenever you feel like it, we can spend some time to try to figure out what's wrong. Just tell me.
Aleksander Vognild Burkow
Great to see this being released now.
I upgraded our local project, the only thing missing now is for us to get const someresult = yield call(someTypedFunction) to work, but that's blocked on typescript adding more support, right?
Mateusz Burzyński
This cant yet be expressed in TS
There has been discussion around adding eslint plugins with autofixer that would annotate those for u
Prateek Chachra
Hey guys
needed some help
Trying to setup redux saga
The method in 'takeLatest' is being called more than 6000 times in one go, which is hanging my app
And it's only supposed to be called just once
Ryan Bas
Anyone familiar with redux-saga-test plan able to help me stop banging my head on the wall
Does Saga effects need to be async? What for a sync effect in my app?
e.g. A library requires me to call .setLocale() when changing locale. It's a sync side effect.
Mateusz Burzyński
@Menci effects can be synchronous, yield call(() => 'foo') works
Phan Dang Dien

I guys, I'm struggling in finding a proper way to use saga in my app. For example I have a fetch action and a notification function to push notification when the fetch action failed or succeeded.

The question is where should I put UI-related logic like notification, confirmation modals, router redirection...? Should I put it right in the saga?

That doesn't seem to be a good choice for me because I want the app logic to be separated from UI logic. That way I can later use my app logic for mobile and other devices and the only thing I need is to rebuild the UI itself. Can someone tell me what is the best practice for saga? Thank you!

A Flores
@phandd Hrm...I think that sagas are mainly for managing async things, I think of it as a place to put my 3rd party interactions(3rd party being another server, my own server, a service of some sort, etc) Usually, I will take that data, and feed it into redux. Redux is piped in to my individual components.
wrt ui related things, if it is self contained within a single component I will actually handle it there. If it were something that had to do that had to communicate over multiple components I might use a saga? but I would probably just modify my store and have the respective components update themselves from redux.
for router redirection, I will usually render a redirection tag based on certain critiria directly in my component.
A Flores
sometimes if I have something that needs to have a timeout before fetching more data, I will put that type of thing in sagas as well
Prateek Chachra
Hello everyone! How do you guys optimize API calls?
My API call takes about 1300 ms at max on postman, but on react native it takes 5 times that time
Dimitri Mitropoulos
hi all!
I'm trying (and failing, hard) to introduce redux-saga into an app that uses typescript (ts-loader via webpack) and babel7. When I try to build I just get:
ERROR in ./node_modules/redux-saga/effects.d.ts
Module build failed (from ./node_modules/thread-loader/dist/cjs.js):
Thread Loader (Worker 0)
Debug Failure. Output generation failed
    at PoolWorker.fromErrorObj (/home/dimitri/src/github.com/weaveworks/wkp-ui/app/ui/node_modules/thread-loader/dist/WorkerPool.js:262:12)
    at Object.transpileModule (/home/dimitri/src/github.com/weaveworks/wkp-ui/app/ui/node_modules/typescript/lib/typescript.js:116825:29)
    at getTranspilationEmit (/home/dimitri/src/github.com/weaveworks/wkp-ui/app/ui/node_modules/ts-loader/dist/index.js:283:74)
    at successLoader (/home/dimitri/src/github.com/weaveworks/wkp-ui/app/ui/node_modules/ts-loader/dist/index.js:66:15)
    at Object.loader (/home/dimitri/src/github.com/weaveworks/wkp-ui/app/ui/node_modules/ts-loader/dist/index.js:22:12)
 @ ./src/store/index.ts 122:16-45
 @ ./src/store/configureStore.ts
 @ ./src/index.tsx
 @ multi ./src/index.tsx webpack-hot-middleware/client?overlay=false
ℹ 「wdm」: Failed to compile.
I've been struggling with this for about 6 hours and I've tried everything under the sun I can think of including:
  • introducing every combination of the babel polyfills, regenerator-transforms, runtimes, etc.
  • testing to make sure generators transpile in my project at all (they do)
  • flipping every option I can think of in my tsconfig
Edoardo Gallo

Hey guys! I'm looking for the best way to manage these sagas

  • classic LOGIN/LOGOUT process but - after login and before logout - i need to manage a websocket connection. For example:


Does the rootSaga need to watch for the WS actions or is it better that the LOGIN/LOGOUT workers handle some logic?

Within the LOGIN/LOGOUT workers i can fork/dispatch the actions to OPEN/CLOSE the websocket. Looking for the best approach in this case.
anyone know this issue
about exception handing
Alexei Kozhushkov
Hi, could you please advise me with following?
I'm loading react app with URL query string arguments. I would like to check if they are valid and fire an API call to fetch app data from server.
I got URL query string params using query-string in componentDidMount() but now I would like to dispatch actions to update state with extracted params and fire an API calls from redux-saga. What's the recommended way to do so?
Katherine Xu
Hi all, would anyone happen to know if there is support for the redux batch() command with Redux saga ( https://react-redux.js.org/api/batch )?
Hi all,
I have a question about redux-saga, here is my problem. When I’m rendering a list on React, I’m dispatching the exact same saga multiple times concurrently for the same API call. I’m wondering if there is a way to tell saga to automatically cancel the duplicates and only call one of them.
Andrew Craswell
Looking for some quick advice. I'm building a generic Saga wrapper at my company to let people connect to an API endpoint, and specify a Saga EffectCreator. As the EffectCreator (takeEvery, takeLatest, etc) process the API method, it assigns a unique Id to each request and tracks it in the store so the component can check the status. This works great for takeEvery, but when 3 components request the same endpoint simultaneously while using takeLeading, the subsequent tasks get ignored. This leaves entries in my Redux store that are still designated as isFetching, and my components think their data is still loading. How can I track (a) which tasks were actually taken, (b) which were ignored, and (c) dispatch an action to tell my component that the request was superseded?
It feels like the only way to accomplish this may be to recreate the EffectCreators and add my own custom handling logic in each, but I really want to avoid that.
Rob Cecil
Hello, what is the Redux Saga pattern for calling streaming APIs ?

Hey guys.. I'm having response is undefined on my request using sagas

export function* getCompanies({ payload }: any) {
  try {
    const { data: response } = yield call(api.get, '/companies-list', {
      params: {
        keyword: payload,
    const { data } = response;
    yield put(handleFetchCompaniesAsync.success(data.companies));
  } catch ({ response }) {
    yield all([

export default function* companySagas() {
  yield takeLatest(handleFetchCompaniesAsync.request, getCompanies);

What could be the problem here?