Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
  • Sep 01 22:08

    dependabot[bot] on npm_and_yarn


  • Sep 01 22:08
    dependabot[bot] closed #2210
  • Sep 01 22:08
    dependabot[bot] commented #2210
  • Sep 01 22:08
    changeset-bot[bot] commented #2217
  • Sep 01 22:08

    dependabot[bot] on npm_and_yarn

    Bump tar from 4.4.8 to 4.4.19 … (compare)

  • Sep 01 22:08
    dependabot[bot] labeled #2217
  • Sep 01 22:08
    dependabot[bot] opened #2217
  • Aug 30 14:47
    UniKylin commented #2129
  • Aug 26 15:25
    gmunumel opened #2216
  • Aug 26 12:14
    Andarist commented #2207
  • Aug 26 12:14
    Andarist commented #1592
  • Aug 26 11:35
    madjam002 commented #2207
  • Aug 25 10:27
    springjazzy closed #2147
  • Aug 25 10:26
    springjazzy commented #2147
  • Aug 25 10:25
    springjazzy commented #2147
  • Aug 25 09:04
    springjazzy commented #2147
  • Aug 19 11:36
    hugows commented #78
  • Aug 19 11:35
    hugows commented #78
  • Aug 15 19:08
    sangchatb opened #2215
  • Aug 13 00:45

    dependabot[bot] on npm_and_yarn

    Bump path-parse from 1.0.6 to 1… (compare)

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?

Jonathan Jacobs
I have an issue with Fast Refresh on React Native, my sagas are started multiple times and in particular I have several eventChannels that are never closed. I've read redux-saga/redux-saga#1961 but I don't think helps me figure out how to properly close my channels. The pattern I'm using here is something like this:
const channel = eventChannel(…) // Unsubscribe is returned etc.
yield takeEvery(channel, process)
I'm not sure what I have to do to know when to close the channel. takeEvery returns a task (and is non-blocking) so I would need some way to say "wait until this saga is cancelled, and then close the channel" but I don't know how to express that.
Jonathan Jacobs
I've come up with the following method for a single takeEvery:
const channel = …
try {
  const task = yield takeEvery()
  yield join(task)
} finally {
  if (yield cancelled()) {
I don't know if this is silly, or if there's a better way but I can't see another way to ensure my generator function doesn't finish (i.e. run out of things to yield) and leave me with no way to detect cancellation. This seems like it would be a fairly common issue though, maybe I'm just searching for the wrong thing?
Is this a real pattern or is this an anti-pattern? yield all([takeEvery(…), takeEvery(…), takeEvery(…)])
lieut z
@dimitropoulos Hi, I have the same problems. What's your solution?
Tew Tawan
Guy, need some help. I want to use 'useApolloClient' in saga context, how can I do that? Any recommendation? I trying to create saga middle or redux middle to use setContext but not working as I expected.
Henrique Barcelos

Hey guys, I have a more of a conceptual problem I've been struggling with in the past couple of days.

I have to subscribe to N event streams and react to the events occurring in them. Those are standard Node-like event-emitters.
I also have a facade API which should merge those N event streams together into a single one.
My initial thought was to convert the subscription into an async generator:

  async function* subscribe({ fromBlock = 0, toBlock = 'latest', filter = {} } = {}) {
    let res;
    let rej;
    let promise = new Promise((resolve, reject) => {
      res = resolve;
      rej = reject;

    const subscription = linguo.events.allEvents({ fromBlock, toBlock, filter });
      .on('data', event => {

        promise = new Promise((resolve, reject) => {
          res = resolve;
          rej = reject;
      .on('error', err => {
        promise = new Promise((resolve, reject) => {
          res = resolve;
          rej = reject;

    while (true) {
      try {
        const event = await promise;
        yield event;
      } catch (err) {
        console.warn(`Canceling event subscription for contract ${linguo.options.address}`, err);


Then to combine the multiple subscribe() calls, I've found this merge operator from the repeatable library.

Then I happily wrote my saga:

export async function* subscribeSaga(action) {
  const { fromBlock, toBlock, filter } = action.payload ?? {};

  const linguoApi = yield getContext('linguoApi');
  const subscription = yield call([linguoApi, 'subscribe'], { fromBlock, toBlock, filter });
  for await (const evt of subscription) {
    console.log('>>>', evt);

Only to find out then that redux-saga does not support async generators :/

Any ideas?

Mihai Moraru
Hi guys, I just posted an article on medium about a simple way of using redux saga (+ reduxsauce). Check it here. I'd appreciate any feedback.
Cooper Maruyama
Is there an idiomatic way to replace the following super common pattern with redux-saga?
componentDidUpdate(prevProps) {
  const didIdChange = prevProps.id !== this.props.id;

  if (didIdChange) {
Gursewak Singh
Hi, I am using saga, and its rendering twice I don't understand the reason
Here is a screenshot of the response and it's happening only on testing server

Hey guys,
Any idea why my second argument externalData is rejected in sagaMiddleware.run(rootSaga, externalData); ?

Tells me that .run takes 1 arg only but the doc doesn't say so

Ambika Kumar
Hello Developers,
What is the best and secure approach to store logged-in user information in React redux application. please help me.
Hey guys. Why this does this retry work only one time?
I suppose it should work three times

Hi developers
We are Ukraine based IT startup and we are looking forward to hiring 2 (two) React.js developers in a few days.
Recruitment process is simple.

  1. There is a small test project to get qualified.
  2. Once you have finished the task, you will be required to send your CV.

If you are interested, DM me

Kyrylo. K
Hello, everybody
I want to know the differences between Redux-thunk and Redux-saga correctly