Questions tagged [ngrx]

NgRx is a reactive state management library for Angular based on flux design pattern.

NgRx provides a set of reactive libraries for Angular.

It includes:

Store: RxJS powered state management for Angular applications, inspired by Redux

Effects: RxJS powered side effect model for @ngrx/store

Entity: Entity State adapter for managing record collections.

Router-Store: Bindings to connect the Angular Router with @ngrx/store

Store-DevTools: Developer Tools for @ngrx/store

DB: RxJS powered IndexedDB for Angular apps


See Official Docs for more Info

4430 questions
1
vote
1 answer

update ngif depending on input value

I'm Trying to do a search to filter posts in a blog the posts are got from the ngrx store as an observable so when the user changes the value of the input the posts (with async pipe) will be updated by a pipe called filter-posts and if the new array…
muaaz
  • 101
  • 11
1
vote
0 answers

when testing @ngrx selectors in an @angular project unit test execution is flaky

Hello dear stackoverflow community, we encounter flakiness when executing unit tests in our project. we would appreciate any help or input on that issue. Issue do-something.effects.spec.ts and do-something.selectors.spec.ts unit tests seem to run…
1
vote
2 answers

Angular-Mapping value from NgRx selector into an object to be returned as an Observable

I want to return an observable (line 6) as DataObject. Line 9 is listening to store changes, so when there is a store change - lines 10,11,12 execute but not before store change right? Or Will it get the existing value in the store and execute the…
1
vote
1 answer

Angular 12 Error: Cannot match any routes. Navigate to named outlet NgRx Effect

I am working with named router outlets with params and I need to navigate to it from an effect, but i am facing an error. Does NgRx Router Store solve this problem? Or may I need a flag inside the store, then select it and do the navigation in a…
Camilaebf
  • 21
  • 5
1
vote
1 answer

Angular-Listening to store changes & emit a value from a Service component to a different component - only after Service completes certain operations

Here we have to classes GetDataAsyncService which waits for change in the store (and not executes the block of code under it until a change in the store ( this.getDataAsyncService.getAsyncData().subscribe((data)=>{ )}). When it is called from…
1
vote
1 answer

How Applay Filter to Observable and get the length of list to count notification for each user

How Applay Filter to Observable and get the length of list to count notification for each user: how can I get the count of notification type number for each user by html code
{{…
Aymen Ragguem
  • 156
  • 2
  • 15
1
vote
1 answer

How can I get two variables in effects from store to send it to API with angular ngrx

this is effects methode I try to get skip number and selectUser to send it to Api, the skip is ok but selectuser not.. loadMoreAction$ = createEffect(() => this.actions$.pipe( ofType(directMessagesAction.loadMoreAction), …
Aymen Ragguem
  • 156
  • 2
  • 15
1
vote
1 answer

In ngrx effect the operator after concatLatestFrom marks the action as type never

I'm getting a TypeScript syntax error in the filter operator saying Property "searchCriteria" does not exist on type "never". I must be failing in my understanding of concatLatestFrom because I can't get this operator to work (compile) in the effect…
wiredprogrammer
  • 545
  • 4
  • 13
1
vote
0 answers

Async side effect depends on another effect

I have two side effects. One of them presents a global loading spinner and the other one dismisses the spinner again. For presenting and dismissing the loader I have created a LoadingService. Note that the presentLoader() and dismissLoader() methods…
Pascal
  • 75
  • 8
1
vote
1 answer

NGRX returns success before throwing error

I am throwing an exception in my service and trying to catch the exception in my effect and return the correct toast on the frontend. What happens: It looks like i get a success message and then an error is thrown, i see the error in the console…
Snipered
  • 53
  • 4
1
vote
2 answers

Do operation on two Observables in angular

I have a service which gets two observables, storeValueOne$ and storeValueTwo$, which are of type number and update frequently but not at the same time. I want to add the values of storeValueOne, storeValueTwo and store them into another…
herbert mühlex
  • 261
  • 4
  • 14
1
vote
2 answers

Access NgRx actions/selectors of a lazy-loaded module

My question is quite similar to this one : Angular 7, Ngrx, Rxjs 6 - Accessing state between lazy loaded modules Having an angular root module (AppModule) that wants to be notified if an action occurred in a lazy-loaded submodule (an AuthModule that…
djflex68
  • 21
  • 4
1
vote
2 answers

ngrx/data - alternate id `has a missing or invalid entity key (id)`

As there are many IDs in the system, my entities linked to database tables and the tables use 'DbId' as the primary key - instead of the ngrx/data default: 'id'. That is addressed inside the EntityMetadata map by the property: selectId. I followed…
Felix
  • 1,662
  • 2
  • 18
  • 37
1
vote
1 answer

NgRx live example fails with error message "Property 'store' is used before its initialization

I'm just getting started with NgRx and I'm struggling with the live example in the Walkthrough of NgRx (https://ngrx.io/guide/store/walkthrough). It fails with the following error message: Property 'store' is used before its initialization. Does…
Frank Jusnes
  • 175
  • 1
  • 13
1
vote
2 answers

How to access nested property from ngrx selector Observable?

Initial Data definition and Interface: export interface IInitialData { version: { patch?: string; Version: string, build: number, }; } export const initialStateInitialData = { version: { build: 0, …
Akul Aggarwal
  • 61
  • 2
  • 6