2,479 questions
-1
votes
0
answers
24
views
How to Dispatch Redux Actions from WebSocket onMessage in Redux-Saga?
I am developing a React Native app using Redux and Redux-Saga for state management and handling side effects. I’ve implemented WebSocket communication for a chat feature. Everything works fine. But,...
1
vote
1
answer
89
views
React router dom v6.26.1 changes url but not re-render the component
I'm having an issue with the page refresh after, when clicking on the button url gets changed in the browser but the page doesn't refresh the correct component, no browser error no terminal error, ...
0
votes
0
answers
42
views
Session removal saga terminates prematurely when handling unauthorized requests
I'm encountering an issue with Redux-Saga where my session removal process is not completing fully when handling unauthorized (401) requests. Here's the scenario:
When a request receives a 401 (...
0
votes
0
answers
47
views
Queue up multiple 401 failed requests to avoid getting spammed with 401s
In our React app using Redux-Saga and Axios, around 30 requests are made on page load. When the token expires, all requests receive 401 status codes. Each request tries to handle the 401 status code ...
0
votes
1
answer
41
views
How to attach CANCEL callback to the axios request promise so saga can handle it in TypeScript?
I want to attach CANCEL callback to the promise so saga can handle it.
My code:
import { CANCEL } from 'redux-saga';
cancellableCall = <T = any, E = ApiError>(
options: AxiosRequestConfig,
...
1
vote
1
answer
141
views
Redux Saga pending/success/failure pattern - how to handle interruption
I am using redux-saga and @reduxjs/toolkit. I make some webservice requests and save their responses into redux, and I am following a pending/success/failure pattern I've seen mentioned in a few ...
1
vote
1
answer
56
views
Redux-saga catch error and display notification
I'm facing an issue and I'm looking for the best solution to fix it. I want to display a notification on my dashboard in case of an error. To achieve this:
I'm using Redux-Saga to catch the error and ...
0
votes
0
answers
115
views
Are put actions in redux-sagas dealt with atomically together with the triggering action?
Suppose I have a redux state with two slices. Each slice holds one number.
One number is controlled with the action SET_NUMBER and the other number is controlled with SET_OTHER_NUMBER.
Furthermore I ...
1
vote
1
answer
110
views
Toast error notification still on sign up form after returning from another page
When I have signed up failed, then I moved to the another page, the error toast appeared one more time despite the form has been cleared. For example, if i have signed up failed, then i return back to ...
0
votes
0
answers
30
views
Signup Form Handling using Redux-Saga
I'm trying to make the errors appeared on the console, at the moment, when i have successfully registered, the console logs all the information of username, email, password and confirmpassword and ...
0
votes
1
answer
167
views
How to resolve unknown error thrown at useSelector : Unhandled Promise Rejection: TypeError: useSyncExternalStore is not a function?
The full error is :
Unhandled Promise Rejection: TypeError: useSyncExternalStore is not a function. (In 'useSyncExternalStore(subscribe, getSelection, getServerSelection)', 'useSyncExternalStore' is ...
0
votes
0
answers
48
views
Manage WebSocket Reconnection in Redux Saga using TypeScript
How can I adjust the code below of my saga to automatically create a new WebSocket connection when a WebSocket connection is closed and also cancel the previous setupWebSocket() saga worker?
I am ...
0
votes
1
answer
31
views
How to stop saga after specified amount of action calls?
I have a case that I have to call n sagas:
function* mainSaga() {
yield all(
someArrayOfIds.map((id) => call(pollSaga, id))
)
}
pollSaga:
function* pollSaga(id) {
yield race([
...
0
votes
0
answers
83
views
How to mock an anonymous function using jest in redux-saga-test-plan
I'm trying to test a saga using redux-saga-test-plan, but faced a problem of passing an anonymous function as an argument in the "call" effect.
I know that a possible solution could be to ...
1
vote
0
answers
23
views
Define type of response after using call effect in redux-saga
I am using redux-saga to call API in nextjs ver.13 with typescript. This is my watcher
function* getNoteListWorker(): Generator<any, void, any> {
try {
const getNoteListApi = async () =>...
-2
votes
1
answer
67
views
Redux-saga persist with redux-toolkit, A non-serializable value was detected in an action, in the path: register [closed]
I am using redux toolkit and I get this error:
serializableStateInvariantMiddleware.ts:197 A non-serializable value was detected in an action, in the path: `register`. Value: ƒ register(key) {
...
0
votes
0
answers
35
views
Take Latest Redux Saga Infinite Loop
We have a Redux Saga that seems to loop infinitely for some reason and we are unsure why/how that is happening. For the record, this code was previously working as is but we just recently upgraded ...
0
votes
0
answers
52
views
Mock multiple capsuled GraphQL requests in JEST
I will test my redux-sagas, and stuck by mocking my api requests.
The scenario is like this:
I have a GraphQL API and each request is capsuled (axios) in a requestApiUtil.
like
/path/api/...
0
votes
1
answer
49
views
Unable to see asynchronous actions dispatched in Redux DevTools when using Redux Toolkit, Redux Saga, and Redux DevTools
I'm currently using Redux Toolkit along with Redux Saga for managing asynchronous actions in my React application. However, I'm facing an issue where I'm unable to see asynchronous actions being ...
0
votes
0
answers
88
views
Race condition SSE Redux Saga with additional REST request
function* firstSubscribeSSESaga() {
try {
// here deleted unnecessary information
while (true) {
const event = yield take(channel)
const sseEventData: {
someProperty1: ...
1
vote
1
answer
325
views
TypeError: b is not a function error in React.js with redux-saga
I am working with react application with redux-saga. It gives below run time error.
b is not a function
TypeError: b is not a function
at http://localhost:3000/static/js/bundle.js:58975:48
at ...
3
votes
0
answers
807
views
Go-redis context canceled when calling from Typescript
I am trying to create a web admin dashboard, using Typescript with redux-saga fro frontend and for backend Docker, Golang, Postgres as "main" db and Redis to store access tokens; I followed ...
1
vote
1
answer
103
views
Sequencing of actions are not working by using redux saga actionChannel
We have a multiple custom React file input components(let's say 4 different input file sections). Need to upload file for each component which internally triggers an action and call api call to ...
0
votes
1
answer
147
views
Missing "./saga" specifier in "redux" package
I'm learning redux-saga and tried to setup in my React application but I was stuck with this error:
Missing "./saga" specifier in "redux" package
product.saga.js
import { ...
0
votes
0
answers
44
views
redux_saga Put doesn't update the state in flutter
I'm using redux and redux_sage work for my flutter app.
my_store.dart
Store<AppState> myStore() {
var sagaMiddleware = createSagaMiddleware();
AppState appReducer(AppState state, action) {
...
0
votes
0
answers
41
views
Redux saga, argument of type is not assignable to parameter of type
I am trying to get data from my api in my saga:
function* getVehicleReminderDatesAsync(
action: types.GetVehicleReminderDatesAction,
) {
const {
payload: { registrations },
} = action;
...
0
votes
0
answers
15
views
Image not being sent to NodeJS api from ReactJs redux-saga using yield call()
This is my saga function:-
// Sagas for Update Profile Starts //
function* updateProfileStartHandlerSaga(action){
try
{
console.log(action.payload)
const {data} = yield call(...
3
votes
1
answer
1k
views
Type error Redux-Saga middleware with Typescript
I am trying to use redux-saga for side effects. As `createStore` is deprecated, I am trying to use `configureStore` from *@reduxjs/toolkit* (version 2.0.1). I followed different tutorials and found ...
-1
votes
1
answer
132
views
api call using redux saga inside a react
I am trying to learn saga by following the below medium tutorial and implement in stackblitz.
But I was getting a path issue, I change by different ways and fixed it.Now I am getting a different issue....
0
votes
1
answer
50
views
Take doesn't listen for actions to be dispatched
I have tried to use yield take(action.type) in my saga.
function* foo() {
console.log('pausing')
yield take(action.type)
console.log('passing')
}
I made sure I dispatched the right action in my ...
0
votes
1
answer
428
views
Issue with waiting for dispatch to complete before running the next function in React Native
I have a function onPressItem in a React Native component that dispatches an action using Redux, and then navigates to another screen using pushScreenOnFormScreen. I want to ensure that the dispatch ...
1
vote
1
answer
28
views
React.js: Unable to to get the updated state back in App using redux-saga
In the app => Working Demo the redux-saga is getting executed, but I'm unable to get the updated state back in my App component. I'm unable to identify why this application is having this behavior.
...
0
votes
0
answers
79
views
What happens to data returned by saga functions?
What happens to data returned by a redux-saga saga? Let's say we have this example code to fetch some categories:
import { REQ_CATEGORIES, getUserId, errCategories, recCategories } from './store'
...
0
votes
1
answer
378
views
How can I use custom hooks functions in saga files?
I am having trouble in using the customHooks with my redux saga here. I am new with the redux saga so couldn't able to get my head around calling the custom hooks function here.
I have created a ...
1
vote
1
answer
111
views
Redux saga, making an syncroneus batch of async requests
I have redux-saga v 0.16.2 without ability of an update to something newer - that would demand rewriting half of this legacy project. Right now I am working on files upload functionality. There is no ...
0
votes
1
answer
85
views
saga test case giving this issue
SO i have this function in my saga file
export default function* rootSaga ()
{
yield all ([
testfunction(),
])
}
For this I am writing this case for this function ,
it ("...
0
votes
0
answers
69
views
Where do i put toastr code in a react redux app which uses sagas?
I have a react redux application that is using sagas to make api calls. I want to use toastr to display error messages. Where do I place the toastr code? In the sagas or in the components?
I can't ...
0
votes
1
answer
64
views
yield put trigger method in takeEvery, this can make endless loop
this is sagas.js file; when I run my web app, an endless loop appears, and log lots of 'getInitList' in console, why?
import {takeEvery, put} from 'redux-saga/effects';
import {INIT_LIST_DATA} from './...
-2
votes
2
answers
142
views
State setting, state rehydration and api calls are happening twice
I'm using
apisauce: ^2.1.6,
react: 18.1.0,
react-native: 0.70.4,
react-redux: ^8.0.4,
redux: ^4.2.0,
redux-logger: ^3.0.6,
redux-persist: ^6.0.0,
redux-saga: ^1.2.1
The problem I'm facing is each and ...
-1
votes
1
answer
250
views
Using `@apollo/client` `ApolloClient.subscribe` in `redux-saga` [closed]
I want to use redux-saga to manage event-driven changes in app state, while using @apollo/client to subscribe to changes on the GraphQL server.
Are there best practices about how this may / can be ...
2
votes
1
answer
52
views
Why is this.props.counter null?
src/index.js
import React from 'react';
import createSagaMiddleware from 'redux-saga';
import combineReducers from './reducers';
import { configureStore } from '@reduxjs/toolkit'
import CustomCounter ...
0
votes
0
answers
204
views
Redux saga Payload
not really certain about my request
but I'm kind of new to redux saga freshly from redux it self.
on redux when I want to dispatch and action I'll do that by dispatching the action object with the ...
0
votes
0
answers
90
views
Sometimes after the redirection, the page does not get the correct state yet
I have a website. When an anonymous visitor visits https://mywebsite.com/sign?next=/app, he can sign in by Google in a popup window, then https://mywebsite.com/sign?next=/app is automatically ...
-1
votes
1
answer
188
views
React Redux connect is throwing a call signature error with TypeScript [closed]
I am writing this component, however, I am receiving the following error while trying to use the higher order function connect from react-redux. I believe I have defined the types correctly. What I am ...
0
votes
4
answers
1k
views
React Native FlatList Data is not Showing Data
I am Using Redux and My Problem is When First Time My Screen Loads I am getting error
undefined is not an object(evaluating 'response.data')
My Code Is
function LaunchScreen(props) {
const [response, ...
0
votes
0
answers
285
views
API calls with Axios within a Redux Saga's yield call statement prevent the following yield put statement from successfully terminating
I'm making a GET request using Axios inside a saga, and upon completion, I put an action that indicates a successful response.
my-saga.ts
import { throttle, call, put } from "redux-saga/effects&...
1
vote
1
answer
79
views
Dollar sign identifier in redux sagadollar sign identifier in redux saga
I want to send a paginated get request in the saga with Axios get but in the first approach it returns undefined and in the second one it works. in the first one, I used a dollar sign identifier in ...
1
vote
1
answer
584
views
Redux dev tools not working with Next.js, Redux toolkit and Redux Saga
I am trying to get Redux dev tools to work with:
Next.js 13 (App folder)
Redux toolkit
Redux saga
The problem I have is that I cannot view the state. Sometimes it works and works more when I pin the ...
-1
votes
1
answer
108
views
How could I Prevent Hard Coded Intial State of Reducer in Redux whilst initial rendering
I get category state items via the reducer's initial state but it looks a bit of a messy and hard-coded way to get of redux state, for that reason, I just want to fetch the dummy JSON data that I ...
0
votes
1
answer
66
views
Generator function does not pause execution if I call a non generator function inside of it
I have a saga that creates a nesting of setTimeout to post messages via axios like this (for this I call a non generator function in my saga):
import { call, put, takeLatest } from "redux-saga/...