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:

654 questions
6
votes
1 answer

Should we create one Epic per action type? in redux-observable

I am in process of redux-observable learning, and I have some doubts: Should we create an Epic for each action to watch? export const actionEpic = action $ => action$.ofType('ACTION') export const action2Epic = action $ =>…
MatCas
  • 451
  • 6
  • 18
5
votes
2 answers

Can't use redux-observable with Stencil@one : "Class constructor Observable cannot be invoked without 'new'" error on ActionsObservable class

I have a Stencil component library using @Stencil/redux, redux, redux-observable and redux-actions. Everything worked fine before but I'm trying to upgrade to Stencil@One (1.0.0-beta.5). I have now an error during the Redux store creation. This is…
Elvynia
  • 327
  • 2
  • 11
5
votes
2 answers

TypeError: action$.ofType(...).mergeMap is not a function

I am new to reactjs and trying to integrate redux with my existing project. This is my index.js file in store import 'rxjs' import { createStore, combineReducers, applyMiddleware } from 'redux' import { reducer as formReducer } from…
Dark Knight
  • 785
  • 2
  • 13
  • 35
5
votes
1 answer

rxjs v6 / redux-observable v1.0.0: Operators not working in epic

I am using the latest version of redux-observable and Rxjs i.e // My version "redux-observable": "^1.0.0", "rxjs": "^6.3.2" The store - middleware, setup looks like this: // Setting up middlewares import { pingEpic } from './epics'; import…
5
votes
0 answers

error on createEpicMiddleware

When I call createEpicMiddleware(epic) function on Angular2+, there is an error: "error TS2560: Value of type '(action$: any) => any' has no properties in common with type 'Options'. Did you mean to call it?" Even if using the sample official…
jisu lee
  • 81
  • 1
  • 3
5
votes
1 answer

How to use Firestore realtime updates (onSnapshot) with redux-observable/rxjs?

I am able to setup redux-observable with normal Firestore queries export const getStatementsEpic = (action$, store) => { return action$.ofType(GET_STATEMENTS) .filter(() => { const state = store.getState() return state.auth.user …
Jiew Meng
  • 74,635
  • 166
  • 442
  • 756
5
votes
1 answer

Alternative to direct calling of store.dispatch()

Since in the latest redux-observable (0.17) is direct calling of store.dispatch() deprecated, I wonder what is an alternative if I need to dispatch actions from the outside of my redux app. Example: Let's say I have this function which initialize…
trubi
  • 245
  • 2
  • 11
5
votes
1 answer

Cannot read property 'type' of undefined (react-router-redux)

I am trying to redirect to the page after signing out. However, every time when I sign out, it directs the page successfully. However, I still got the error Cannot read property 'type' of undefined Further research by "Pause on Caught Exceptions",…
Hongbo Miao
  • 31,551
  • 46
  • 124
  • 206
5
votes
1 answer

Redux Observables / RxJS: How to make epic that returns different actions based on if / else?

I am trying to hook up my app with in app purchases using this: https://github.com/chirag04/react-native-in-app-utils I have an epic where I want to emit success if it succeeds, and failure if it fails. Something like this: import 'rxjs'; import {…
bigpotato
  • 22,922
  • 46
  • 147
  • 286
5
votes
2 answers

Concurrent Ajax requests with Rxjs

I'am currently switched from promises to observables. I am using Redux-Observable for my react app. Basically, I am looking for the best operator that will enable mutliple, concurrent ajax calls and return the responses when all the observables have…
grustamli
  • 193
  • 2
  • 11
5
votes
3 answers

React Native computational heavy task

Very simple and common use case, but I can't find satisfying answer. I have react native app which needs to store some data locally. I am using redux and redux-observables and Realm as a storage. What I need is: some action occur, let's say…
4
votes
1 answer

redux-observable use RxJS to emit progress actions for ajax call

I have been wrestling with this problem and feel like I have a fundamental misunderstanding. I am using the redux-observable library in React which glues redux together with RxJS for handling asynchrony. My problem is that I have to handle a large…
Matthew Crews
  • 3,223
  • 7
  • 30
  • 46
4
votes
1 answer

RXJS redux observable perform multiple api calls

I have an array of contacts and would like to perform an API calls for each object in the contacts array. I have tried to loop over each item and make the call to fetchJson$, however, I realise that this approach is incorrect. What is the correct…
Laurie Williams
  • 373
  • 2
  • 8
4
votes
0 answers

Type 'Dispatch' is not assignable to type 'Dispatch'

hello i'm try to user redux with angular. but i have this error message when i try to run my angular app: ERROR in node_modules/@angular-redux/store/lib/src/components/ng-redux.d.ts(10,31): error TS2420: Class 'NgRedux' incorrectly…
4
votes
3 answers

How to prevent starting the same call twice from epic

My epic wakes up when the REMOTE_DATA_STARTED action is dispatched and it fetches data using action.url and action.owner. I need to make sure I don't initiate two concurrent calls to the same owner/url. Once the call for a owner/url is completed,…
Sylvain
  • 18,671
  • 22
  • 89
  • 141
1 2
3
43 44