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
4
votes
0 answers

RxJs/Redux/Angular - Dynamic sort functions from multiple observable streams

I have an angular application that is using NGRX as a state store for data coming from an API. The primary data in the application is a collection of inventory items. Each item has properties that are keyed to child collections. (ie. manufacturerId…
Greg Kopp
  • 287
  • 4
  • 10
4
votes
3 answers

Angular & NGRX: Filtering on a selector using NGRX entity

I am trying to filter out the payload data by a property. //reducer.ts case MessagesActionTypes.LOAD_Message_SUCCESS: { console.log('reducer='+ JSON.stringify(action.payload.Messages));//receiving data here return…
prabhat gundepalli
  • 907
  • 3
  • 15
  • 39
3
votes
1 answer

Does ngrx/data provide a way to define a custom base API path for my DefaultDataService and then reference that path?

I'm using Angular 13 with NgRx/data and entities (v 13). I have defined the following data service, in which I wish to override the URL used to retrieve entities ... export class MyObjectService extends DefaultDataService { ... …
Dave
  • 15,639
  • 133
  • 442
  • 830
3
votes
2 answers

How to get NGRX/Entity length in the reducer?

In a client project I use NGRX/Store and NGRX/Entity. While the majority of the store consists of the Entities, I have to store additional values in the state. For business reasons, I need the length of all items at a certain point in time. export…
EchtFettigerKeks
  • 1,692
  • 1
  • 18
  • 33
3
votes
2 answers

How to update order of entities in NGRX? angular 9

I am building an application, where I have N columns (N lists of items) and by using a drag & drop from angular material I am able to move items between them. I am also using NGRX and EntityAdapter in my app. I would like to ask, how can I properly…
Mateusz
  • 1,163
  • 2
  • 13
  • 25
3
votes
0 answers

Angular/NGRX: Strange behaviour with entity and selectAll?

seletAll from getSelectors() fire event without change into own feature store, but when the root store changes. Open the the demo and click on the button. The button dispatch a change into the root store, but selectAll from the feature store also…
ar099968
  • 6,963
  • 12
  • 64
  • 127
3
votes
1 answer

how to EXTEND Custom Entity Collection Reducers in @ngrx/data

After reading and trying everything so far to update my additionalCollectionStates to my EntityCollection (based on the few infos from the docs, this SO Question, this other SO Question, another SO question and an issue from the github repository) I…
hreimer
  • 785
  • 8
  • 31
3
votes
0 answers

Override @ngrx/data, @ngrx/entity Actions, Reducer, Effects

I'm new to @ngrx/data and trying to understand how I can override the reducer & actions. My current problem could be solved in other ways like adding an extra method, reducer & action but I would probably need this answer in the future. The problem…
3
votes
2 answers

@NgRx how to Many to Many relationship between entities?

Let say i have this state: { "appointments": { "ids": [...], "entities": [ "0": { ... mandatoryRecipients: ['0','3'] }, "1": { ... mandatoryRecipients: ['1','2','0'] …
3
votes
1 answer

Should I use ngrx-data, if the content-type I'm receiving is JSON-LD + Hydra?

I love the advantages of JSON-LD, Hydra and just found out about NgRx/data. I tried using it without customization, which obviously didn't work. Today I spend some hours on the documentation, which left me with even more question. The important…
0nCeDE
  • 33
  • 2
3
votes
1 answer

Entity removed from cache despite error on DELETE

I am using Angular 8 with @ngrx/data to manage my entities. When I initiate a delete operation which fails (server returns 500), the entity is removed from the ngrx client side cache, despite it not being deleted on the server. How do I prevent the…
Aviad P.
  • 32,036
  • 14
  • 103
  • 124
3
votes
0 answers

Composing selectors in ngrx store with entities

I am currently working on an ngrx store project using ngrx entites in which I would like to compose some selectors, like this: export const selectProductById = (productId: number) => createSelector( selectProductState, productsState =>…
serlingpa
  • 12,024
  • 24
  • 80
  • 130
3
votes
1 answer

how to use ngrx entity selectors?

im using ngrx entity for my store the problem i cant select the store entities with selectors. i did as the code in this example https://github.com/angular-university/angular-ngrx-course/blob/master/src/app/courses/course.selectors.ts in my…
Alex Koretzki
  • 155
  • 2
  • 11
2
votes
1 answer

ngrx store - select one entity to show in a separated template

I have a blog application and I'm using ngrx. the application -for now- have two objects in the store { "posts": [...], "users": [...] } now I want to make a separated component to show a single post (selected-post.component). I tried to select the…
muaaz
  • 101
  • 11
2
votes
1 answer

How do I create a NGRX selector that combines data from two different feature modules?

I want to do this: export const selectPlacesForCurrentCustomer = createSelector( selectAllPlaces, selectedCustomerId, (places: Place, customer_id: string) => places.filter((place) => place.customer === customer_id) ) However when I do…
calbear47
  • 1,060
  • 2
  • 18
  • 38
1
2
3
11 12