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
0
votes
1 answer

updateOne of ngrx entity is not changing the state

i have my actions setup like this export const bankAccountUpdating = createAction( '[Create New Account Component] Account Updating', props<{ update: Update }>() ); export const bankAccountUpdated = createAction( '[Bank…
Raas Masood
  • 1,475
  • 3
  • 23
  • 61
0
votes
1 answer

pessimistic update using ngrx entity

i have my actions setup like this export const bankAccountUpdating = createAction( '[Create New Account Component] Account Updating', props<{ update: Update }>() ); export const bankAccountUpdated = createAction( '[Bank…
Raas Masood
  • 1,475
  • 3
  • 23
  • 61
0
votes
1 answer

How to do the ngrx state structure correctly?

I am trying to implement a feature state which has a graph state, two subfeatures: a node state and a link state; the graph state and reducer I am implementing it like this: export interface GraphState { [fromNode.featureKey]: fromNode.State; …
Chi
  • 355
  • 4
  • 14
0
votes
1 answer

How to get values from a function that is a selector?

I am using a selector that is retriving an array of cars, but when I tried to test I am getting: TypeError: agency.getCars is not a function describe('selectCars', () => { it('should return car array', () => { …
Tabares
  • 4,083
  • 5
  • 40
  • 47
0
votes
1 answer

ngrx entity adapter is not updating a sub property of a required property

I have an object maintained in ngrx store like shown below - { . . callStatus: ClientStatus; . . } and ClientStatus is a further nested interface like - interface ClientStatus { status: boolean; csrObject: csrStatus; } now in an API…
0
votes
1 answer

Ngrx Selectors composition Circular Dependecy

Ive two entities: EntityA and EntityB. EntityA need selectors from EntityB in order to compose a new one. Then, on EntityB we need selectors from EntityA in order to compose a new one. That generates a circular dependency error. Whats the best…
Daniel Heras
  • 33
  • 1
  • 5
0
votes
2 answers

ngrx/entity for whole state or part

I'm not sure I understand @ngrx/entity package. There are of course examples but I didn't found any with a state bigger than one property/subject. So before using @ngrx/entity my sub state look like below. Yes it's actually a sub state. That means…
userbb
  • 2,148
  • 5
  • 30
  • 53
0
votes
1 answer

How to pass generic type into a generic selector?

I have a problem with Typescript and I don't know how to solve it... I created a generic state to manage multiple entities. Each entity has it own interface and each of them is a part of a generic type (called Reference in my example). That I want…
Adrien SAULNIER
  • 1,651
  • 1
  • 13
  • 19
0
votes
3 answers

Creating different state for same component using NgRx

My scenario is to create a different independent states of same component, so when anything changes on one component cannot affect other component states. The problem i am facing is whenever i am changing anything in one component its updating other…
anupkumar
  • 357
  • 4
  • 14
  • 28
0
votes
2 answers

Dealing with hierarchical data in ngrx EntityState

I have a database containing a table of organisations with properties orgref, parentorgref, name. { orgref: 1, name: "Level 0 org" } { orgref: 2, parentorgref: 1, name: "Level 1 org A" } { orgref: 3, parentorgref: 1, name: "Level 1 org B" } {…
EricP
  • 173
  • 2
  • 14
0
votes
2 answers

Is it possible to emit an error with NgRx createSelector?

May be there is a different way to solve it (like create another selector especially for errors) export const getMSFState = createFeatureSelector('st'); export const selectCreatedSensor = createSelector( getMSFState, …
Daniel Delgado
  • 4,813
  • 5
  • 40
  • 48
0
votes
1 answer

Ngrx: how to combine simpe store pattern with entity state?

Recently sorry if it's a duplicate of someone question. However I can't find solution for my problem. I faced with a problem that I want to make my store state a little bit complex that ngrx/entity provides but I don't know how to make it…
hofshteyn
  • 1,272
  • 4
  • 16
  • 33
0
votes
1 answer

How do I synchronize local store with Firestore using ngrx entity?

I am using NgRx and Firestore and I am trying to figure a way to get the local store to stay synchronized with a firestore collection. I have an observable set up that fires when the firestore collection is updated, but in my reducer I'm not sure…
mattc19
  • 678
  • 1
  • 11
  • 23
0
votes
2 answers

Angular NGRX Entity counting the same object

I have a call where I get a list of Ids of person who have outstanding reports to file, and I want to keep track of the amount of reports that person has outstanding. I'm storing that data using EntityAdapter. Now I can't figure out how to keep…
James D
  • 1,975
  • 2
  • 17
  • 26
0
votes
1 answer

How to create collection of EntityState in NGRX

Is it possible to create a State in NGRX like below? export interface Invitation { id: string; sender: string; receiver: string; } export interface InvitationsState { invitations: { [key: string]: EntityState }; loaded:…
Vivek Kumar
  • 4,822
  • 8
  • 51
  • 85