NgRx, returning the combination of 2+ states

51 views Asked by At

I have a website with virtual currency.
I want to disable all tools that include transactions of any sort when one is on progress (betting on a contest, withdrawing, depositing money etc…).
To this purpose I would like to have a single selector that returns a boolean specifying if there are transactions taking place.
F.E.

export const getTransactionsRunning = createSelector(
  getState,
  getPartOfTheState,
  getPossiblyAPartOfTheStateNotInThisReducer,
  (state: StateSomehowMerged?) => state.case1 || state.case2 || state.case3,
);

Is it possible to do anything like that natively with NgRx, or do I have to create a function to merge the observables of the 3?

0

There are 0 answers