Questions tagged [ngrx-entity]

Entity State adapter for managing record collections with ngrx

@ngrx/entity provides an API to manipulate and query entity collections.

  • Reduces boilerplate for creating reducers that manage a collection of models.
  • Provides performant CRUD operations for managing entity collections.
  • Extensible type-safe adapters for selecting entity information.
177 questions
1
vote
2 answers

Why are Ngrx Entity ids normally used as a string?

I've been looking at examples for setting up boilerplate for ngrx entity and was curious why most people set up their model with string type id. It's strange because for the EntityState, the selected id is then stored as a number. For the most part,…
eggplant
  • 91
  • 11
1
vote
0 answers

Issues with pullling Ngrx Entities in Store

I have been developing an app to learn Angular Ngrx Store and Entities. The app used the example app from ngrx/platform as a starting point. The code and app is here on StackBlitz I am trying to use a createSelector to filter out the pomos with a…
David Ruyle
  • 33
  • 1
  • 7
1
vote
1 answer

Select slice consisted of several entities in NgRx Store

I use NgRx Entities to create state for 'logs' reducer consisted of Log entities: EntityState. Then I want to subscribe from my Angular component to several Log entities. If it was only one Log, I would use: this.store$ .select(appStore =>…
tengu666
  • 13
  • 4
0
votes
1 answer

Adding a child object to a normalized State with NgRx

I'm currently working on a businessPartnerEditor Feature for an angular frontend. I'm getting a nested businessPartnerComplete object from my backend. //simplified object as received from backend: { id:number, globalId:string, ..., …
0
votes
1 answer

NgRx store select Vs map behaviors

I have a NgRx store EntityAdapter from where I can retrieve a list of customers with the following call: this.store.pipe(select(this.selectCustomersFunction)) .subscribe(items => { console.log('======> Select Customers Function Called'); //…
wonderful world
  • 10,969
  • 20
  • 97
  • 194
0
votes
1 answer

How do I unit test an Angular component with an NgRx Entity Service using Jest

I've recently upgraded to my project to use Angular 15.2.4, Jest 29.5, and NgRx 15.4. My unit tests dealing with components containing NgRx Entity services have broken. This is the entity Service: import { Injectable } from '@angular/core'; import {…
John McArthur
  • 916
  • 1
  • 12
  • 30
0
votes
1 answer

How do i can use concatLastestFrom?

I am try use effects with my store, but 2 days i have this error: Idk why it happened, can u help me please? stackblitz simulation Action: export const LoadMeetings = createAction('[ Meetings/Api ] Load Meetings'); Effect: readonly…
John House
  • 25
  • 6
0
votes
1 answer

ngrx data - collection service and data service, custom endpoint observable

I needed a custom PUT request related to my entity in ngrx/data, I would like to show it as I am not certain it is accurate... Say a I have a movie library and I can add tags to movies with PUT request. My data service: export class MovieDataService…
grx00
  • 19
  • 3
0
votes
1 answer

ngrx entity why order matters

Currently I'm studying ngrx entity and I read in this blog post, that with this feature, we basically say, that our entities are like database tables. But I don't unterstand one thing. Why is there a focus on the order in the collections? Because if…
derstauner
  • 1,478
  • 2
  • 23
  • 44
0
votes
0 answers

Update store from detail view

I have a list of accounts in the store that is displayed on the screen. When the user presses a button a single entity is fetched from the store via a selector "selectEntity". The user can then update the item and the store is updated accordingly…
Mathias F
  • 15,906
  • 22
  • 89
  • 159
0
votes
1 answer

ngrx adapter: composite primary key?

I have an entity with a composite primary key. Is there a way to use composite primary key ? Here is what I try to achieve: // My entity DailyEvent would be uniquely identified with [year, month, dayofmonth] export interface DailyEvent { year:…
gau000
  • 13
  • 3
0
votes
1 answer

NGRX Entity - how to handle isSelected property properly?

I have a table where each row might be clicked and then it should change a color and later on be used to filter out selected items. In each row I have an item: interface Item{ id:string; name:string; price:number; } I am wondering what is…
Mateusz
  • 1,163
  • 2
  • 13
  • 25
0
votes
1 answer

How to sort data retreived from ngrx-entities

I have to sort data fetched from the ngrx-entities-store. I'm not intending to do it inside the reducer because I have three sorting methods to implement and I followed the accepted answer on this stackoverflow post to try to make it done, but I'm…
Prenam
  • 107
  • 9
0
votes
1 answer

ngrx - where to make web requests to update store after successful action

I'm currently working with ngrx and nrg-entity. I wonder what the best practices are for updating the store after a successful web request if the response doesn't contain the entity object that have to be stored. Example: // My state export…
Mossos
  • 97
  • 1
  • 11
0
votes
1 answer

I can't access fields values of data fetched from Ngrx entities selector

I'm struggling to access the "firstname" properties of the "prsnl" data fetched from ngrx entities, because the prsnl data as you can see on the screenshot of the redux devtool, is in a format that I'm not used to, with fields like "ids" and…
Prenam
  • 107
  • 9