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
2 answers

Angular - How to merge these two observables with ngrx some magics?

I have 2 observables. One returns an event and the other boolean. I want to create a new observable that returns the boolean or event while the value in the store is true. Here is the code. This obs1 should wait until the obs2 returns true. const…
mark
  • 129
  • 7
1
vote
0 answers

NgRX - Selector x Effect execution order

I would like to ask about one thing. Imagine you have Effect service class like that: @Injectable() export class GeneralEffect implements OnDestroy { private state?: IAppState; saveState$ = createEffect(() => this.actions$.pipe( …
1
vote
1 answer

Cannot read properties of undefined (reading 'map') NGRX Entity

It happens on the selectAll selector, I Have looked at other answers and I am using a createfeatureSelector, to call the state. I have managed to dispatch actions, save the state to the store but I can't use the selectors. Any help would be highly…
Kav Khalsa
  • 141
  • 3
  • 14
1
vote
1 answer

An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID - "ng add @ngrx/store" in Angular 13

After the upgrade to Angular 13, when I try to add NgRx to the project with schematics (ng add @ngrx/store) I get this error: An unhandled exception occurred: NOT SUPPORTED: keyword "id", use "$id" for schema ID
NeNaD
  • 18,172
  • 8
  • 47
  • 89
1
vote
1 answer

How to handle errors from ngrx effect 's catch block and send it to store in component?

I want to handle the loadfailure sceanrio from my component so that I can handle the no data in view html. Should I add selectors for error sceanrio or handle it in effects. I am pretty novice to ngrx style of fetching data based on actions
not-a-bug
  • 383
  • 1
  • 2
  • 10
1
vote
0 answers

NgRx how to extend EntityState and EntityAdapter

I want to extend EntityState interface to also contain a cache prop and methods of EntityAdapter to manipulate this cache. I faced the problem that I can't easily 'patch' methods of EntityAdapter. Ideally I want to call method…
simply good
  • 991
  • 1
  • 12
  • 26
1
vote
3 answers

bind variables from store to component in angular ngrx

I'm trying to bind the location variable in the component to another variable in the store via selector with ngrx v13 in angular, but when I put the variable with the property in the HTML I get an error: error message: Property 'name' does not exist…
1
vote
1 answer

NgRx effect call API and dispatch action in a loop

Hellow, I have below Json structure, which is provided as a payload in the UpdateOrders action. In the effect, I would like to iterate over the reservations and orders, call the this.orderApiService.updateOrder service and dispatch a…
Gullit
  • 33
  • 4
1
vote
1 answer

Correct refreshing of values using rxjs in Angular

I am wondering how to properly refresh the data in the component if there is any update. In my main panel I have a cart tab which displays the current number of products in the cart This is retrieved using endpoint from the backend My…
jrywin
  • 147
  • 1
  • 11
1
vote
1 answer

Show hidden mat-option when all the others are filtered out

So I have this task where I have to create multiple s dynamically, depending how many "tag types" are returned from the backend. Moreover the s are populated with data (tags). A user can create a new "tag type", which means a…
Aleksandar
  • 101
  • 1
  • 10
1
vote
1 answer

ngrx - 500 error from DELETE api wont trigger failure action

When I call the delete api from my angular app with the correct parameters, the success action is triggered and the behavior is as expected. If any of the parameters or the url is wrong, I get the expected 401, 403 or 422 responses, and the failure…
mhale027
  • 11
  • 3
1
vote
1 answer

Confusion about NgRx Actions in Angular

I've inherited an Angular codebase that contains all the latest tricks and techniques, and I'm having trouble understanding some key things. Normally when I inherit a codebase in any language, I find that I can search it for terms used in one place…
Gus Mueller
  • 185
  • 10
1
vote
1 answer

ngrx updateOne change ids array sorting

I have an index of Invoices loaded from API to the NGRX Store, When the user enters a single Invoice it updates the full details from the API. the Issue is that the index order changed when I user Ngrx updateOne I find that the ids array moves the…
Mansour Alnasser
  • 4,446
  • 5
  • 40
  • 51
1
vote
2 answers

Ngrx selecting data after dispatch

im having a method to dispatch the action to query the account and select the account. I'm not sure if this is the best practice to select the data after dispatching. this._store.dispatch(AccountsPageActions.loadAccountWithDetails({ accountId:…
1
vote
0 answers

NGRX Effect Calling Actions on Different States, Reducer not firing

I have an effect which calls Actions on 2 different states, its current state an another. @Effect() sendPointOfInterestChatMessage$ = this.actions$.pipe( ofType(chatActions.ChatActionTypes.SendPointOfInterestChatMessage), …
JoeyD
  • 693
  • 4
  • 25
1 2 3
99
100