Skip to content
Advertisement

Tag: redux-saga

Jest redux saga API call with response image

I’m trying to test a fetch that responds with a readable stream for an image, but I’m stuck and not sure how to approach this specific case. Is there a simple, easy way to mock the call’s response? Any help would be appreciated 😀 The generator function looks like the following: Answer You can use testing the saga generator function

How to wait for another action in redux-saga

I have a few sagas that may finish and then put another action into the store. Some sagas should only execute after others are executed: they must block, or wait until another one is finished. Summarized as follows: I’m trying to maintain as little coupling between sagas, so bonus points for showing me a way to achieve this outside of

TypeError: store.getState is not a function. (In ‘store.getState()’, ‘store.getState’ is undefined how can i resolve this problem?

i want to cnnect redux-saga witdh react-native but this error keep happen… TypeError: store.getState is not a function. (In ‘store.getState()’, ‘store.getState’ is undefined Warning: Failed prop type: Invalid prop store of type function supplied to Provider, expected object this is my code (App.js) (src/index.js) (store/cofigurestore.js) (reducer/index.js) (sage/index.js) please help me ……… i want to resolve this problem…… but i don’t

Argument of type ‘”MY_EVENTS_LOAD”‘ is not assignable to parameter of type ‘TakeableChannel’ in yeild takeLatest

I have a error on typescript, I’m using Redux and Saga as middleware, these is the error: No overload matches this call. The last overload gave the following error. Argument of type ‘”MY_EVENTS_LOAD”‘ is not assignable to parameter of type ‘TakeableChannel’. I want create a watcher, here: And in my saga file have the function this happen when I do

Polling with redux-saga

I tried to solve polling with the information on this page: https://bigbite.net/polling-with-redux/ The problem I have now is that I see in network that my service gets called too many times. It is called all the time. Should not my delay prevent it to call my fetchStuff in the next round inside while? Should it not wait for 30 sec

How to handle errors in fetch() responses with Redux-Saga?

I try to handle Unauthorized error from server using redux-saga. This is my saga: I fetch data like this: But anyway result is {type: ‘LOG_IN_SUCCEEDED’, user: undefined} when I expect {type: ‘LOG_IN_FAILED’, error: ‘Unauthorized’}. Where is my mistake? How to handle errors right using Redux-Saga? Answer Don’t handle the then and error in your fetchUser method and your saga. Since

Pros/cons of using redux-saga with ES6 generators vs redux-thunk with ES2017 async/await

There is a lot of talk about the latest kid in redux town right now, redux-saga/redux-saga. It uses generator functions for listening to/dispatching actions. Before I wrap my head around it, I would like to know the pros/cons of using redux-saga instead of the approach below where I’m using redux-thunk with async/await. A component might look like this, dispatch actions

Advertisement