Questions tagged [redux-observable]

redux-observable is a redux middleware for performing side effects (epics) using RxJS.

redux-observable is a redux middleware for performing side effects (epics) using RxJS.

Developer documentation and resources:

683 questions
3
votes
1 answer

How to create generic async request epics that uses typesafe-actions AsyncCreator to simplify handling api request flows in Redux

I am a newbie struggling to understand the best architecture for relating epics to async actions in Typescript redux environment.... Is it possible to create a generic async request epic for a given typesafe-actions AsyncCreator instance? I have had…
anon_dcs3spp
  • 2,342
  • 2
  • 28
  • 62
3
votes
1 answer

How to emit event each action

I am an entry level developer of RxJS , I use react, redux, react-redux, redux-observable, above of all in my side project; but I can not figure out , why can not my epic code blocks work as I want , hopes somebody helps my out. /* store…
hex0x02
  • 33
  • 4
3
votes
2 answers

Is there a better solution of this RxJS epic stream?

I have a redux state using redux-observable's epics. I need to solve showing a message after a user deletes an object or more objects. There are two ways how to delete an object: by action deleteObject(id: string) which call deleteObjectFulfilled…
tomaass
  • 61
  • 2
3
votes
0 answers

How to correctly manage fetch errors response with observables and RxJS?

I just recovered a simple auth app built with ReactJS, redux-observable and RxJS. I want to implement an error handler when the API backend send a response > 400. Actually, there is an epic that handle login process on LOGIN_REQUEST event: const…
Sylvain DNS
  • 137
  • 2
  • 5
3
votes
2 answers

switchMap distincted by property in RxJs

Let's say, I have a stream of actions. Each action is assigned some id. Like this: const actions$ = of({ id: 1 }, { id: 2 }, { id: 1 }); Now, for each action, I want to perform some logic in switchMap: actions$.pipe(switchMap(a => /* some…
cezn
  • 2,705
  • 11
  • 16
3
votes
1 answer

Dispatch multiple actions from in redux-observable

I am trying to dispatch multiple actions to redux. Here is my code action$.pipe( ofType(trigger), mergeMap(({ payload }) => from(endpoint(payload)).pipe( map(response => // this works fine //…
Adam
  • 3,415
  • 4
  • 30
  • 49
3
votes
2 answers

how to test RxJs debounced epics?

I'm trying to write a test function to a redux-observable epic. The epic works fine inside the app and I can check that it correctly debounces the actions and waits 300ms before emitting. But for some reason while I'm trying to test it with jest the…
3
votes
0 answers

React-Router-DOM | URL gets redirected to the root Path

I have set an AppRouter with React-Router-DOM. Version 4. I have a table with Links attached to them, and I fetch data from the server, for each one. I want to see the details screen, of each item, when I click the Link in the table. That doesn't…
user10104341
3
votes
1 answer

Combining the results of an outer & inner observable into a single parameter (array) for the next map method

What I'm trying to do is similar to combineLatest, but the second (inner) observable depends on the response from the first ajax.get('/first-url') .map(res => new Thing(res.response) .someMap(thing => …
Jason Spradlin
  • 1,407
  • 9
  • 14
3
votes
1 answer

React + Redux-Observable Timeout Marble Testing

I am creating a web app using React and Redux Observables and I would like to create a unit test for the timeout scenario of one of my epics. Here is the Epic: export const loginUserEpic = (action$: ActionsObservable, store, { ajax, scheduler…
Felipe
  • 6,312
  • 11
  • 52
  • 70
3
votes
1 answer

redux-observable can't catch error from emitted action, error stops action stream

If a js error occurs as the result of an emitted action from a redux-observable epic then it stops all epics from listening to new actions. This is pretty nasty since on the front-end it still appears as if the app is working but in the background…
JamesPlayer
  • 1,834
  • 2
  • 15
  • 21
3
votes
2 answers

redux-observable wont be execute after catchError

I am using redux-observable in my angular project. I have an updateNode function in my epics with catchError handling. I dispatch action DB_UPDATE_NODE many times and everything work well. However the time action execute catchError when I dispatch…
Amir Movahedi
  • 1,802
  • 3
  • 29
  • 52
3
votes
1 answer

Understanding merge in rxjs6 (and redux-observable specifically)

Context: I'm trying to use redux-observable with rxjs v6 to trigger multiple actions after fetching a resource. Problem: I can trigger a single action after fetching the resource no problem; but my attempt to trigger multiple actions has me stumped.…
Magnus
  • 3,086
  • 2
  • 29
  • 51
3
votes
2 answers

How to use signalR with Redux-observable?

I have created Angular SPA application. I am using ASP.net core at server side & client side state is handled by redux-observable using action-reducer-epics. The structure is like : i have configured store, root epics and root reducer and then each…
S2K
  • 1,185
  • 3
  • 27
  • 55
3
votes
1 answer

rxjs observable debounceTime inner next ignored

It seems that debounceTime ignores inner calls to it's subjects next method: var subject: Subject = new Subject(); subject.pipe( tap((a) => console.log("tab:" + a)), debounceTime(300), ).subscribe((a) => { …
user1859022
  • 2,585
  • 1
  • 21
  • 33