Questions tagged [redux-middleware]

88 questions
0
votes
1 answer

Should redux middleware function cascade be so sophisticated?

To define a middleware in redux we need to write a cascade of functions like: const middleware = middlewareApi => next => action => { //logic here } The question is whether this signature is: imposed by any necessities / opens any…
origaminal
  • 2,065
  • 1
  • 11
  • 19
0
votes
0 answers

why shoud I use Redux-Thunk instead of a custom middleware?

I have the following middleware. this middleware acts like the redux-thunk middleware, but passing the dispatcher and the state getter to the action creator function, but also I pass the next middleware that can be called. in this case I can export…
user3550446
  • 405
  • 3
  • 10
0
votes
1 answer

where i can find tutorial for Epics in redux observale?

I have not found a single tutorial which explains detailed about epics. onst pingEpic = action$ => action$.filter(action => action.type === 'PING') .delay(1000) // Asynchronously wait 1000ms then continue .mapTo({ type: 'PONG' }); //…
S2K
  • 1,185
  • 3
  • 27
  • 55
0
votes
0 answers

Nuking realm and remove all references from redux's state

The reason I'm asking is simple, the user can't log out because redux's store is still holding references to RealmObject instances that have already been deleted. The user is presented with the following error as described in Realms issue 1031 I'm…
DerpyNerd
  • 4,743
  • 7
  • 41
  • 92
0
votes
1 answer

Redux middleware: Want to send a response header as a parameter to the middleware

I am making all API calls from a generic function and in some of the responses, a custom response header comes. Using this header, I need to make another API call. Can this be achieved by using Redux middleware? // function 1 return…
Varsha
  • 53
  • 6
0
votes
2 answers

Redux-auto: action chaining vs index reducer

Can anyone tell me what the difference between using chain on a reducer function and doing work in the main index reducer function in redux-auto I want to save an error, A) store/chat/send.js import actions from 'redux-auto' //... function…
aSmater.Me
  • 1,014
  • 7
  • 13
0
votes
1 answer

How to read from to end-points with redux-auto

I am using redux-auto but in the "init" (point 5) I want to hit two Api end-points. The documentation does not cover this case. There is an example export default function (user, payload, stage, result) { switch(stage){ case 'FULFILLED': …
aSmater.Me
  • 1,014
  • 7
  • 13
0
votes
1 answer

redux-auto: async actions are not firing

Hi all I have starting using this lib redux-auto and I want to talk to the my sever. Here is my code - store/user/get.js export default function (user, payload, stage, result) { switch(stage){ case 'FULFILLED': return result; …
aSmater.Me
  • 1,014
  • 7
  • 13
0
votes
2 answers

How is multitasking achieved in Redux Middleware?

Since preemptive multitasking is not available in a browser, and JavaScript is inherently single threaded, how does a Redux Middleware like redux-saga handle infinite loops not designed for cooperative multitasking without triggering the…
Chebyr
  • 2,171
  • 1
  • 20
  • 30
0
votes
1 answer

How to write log in logic in redux?

I am new to redux. I am trying to make a user login. I just want to understand the logic to send information through action. I want a user enters username and password and will be logged in and his status will be marked online. Here is the flow: UI…
0
votes
1 answer

Generic API call using redux-middleware and redux-thunk

I was trying to create a middleware which takes care of all my APIS. Store Configuration In my store I am adding apiMiddleware to use [CALL_API]. Along with this I am adding redux-thunk using extraArgument to access the generic API I create in my…
Harkirat Saluja
  • 7,768
  • 5
  • 47
  • 73
0
votes
1 answer

redux-api-middleware How to do global settings for endpoint

In redux-api-middleware we can create a API call like below, export function loadUsers() { return { [CALL_API]: { headers: { 'Content-Type': 'application/json' }, endpoint: 'http://localhost:1337/users', method: 'GET', …
Raj Adroit
  • 3,828
  • 5
  • 31
  • 44
-1
votes
1 answer

How to pass arguments into custom Redux middleware?

I want to pass an argument into a custom Redux middleware. But I don't know how to use the argument inside the custom middleware. Example: import { createStore, applyMiddleware } from 'redux'; import reducers from './reducers'; const…
Soroush Chehresa
  • 5,490
  • 1
  • 14
  • 29
1 2 3 4 5
6