Questions tagged [ngrx-data]

50 questions
10
votes
3 answers

How to unit test a EntityCollectionServiceBase in @ngrx/data?

I have a dummy service: export class PatientService extends EntityCollectionServiceBase { constructor(serviceElementsFactory: EntityCollectionServiceElementsFactory) { super('Patient', serviceElementsFactory); } } I have the…
Juan Herrera
  • 810
  • 1
  • 10
  • 16
8
votes
1 answer

Can we use NgRx Data with pagination style REST API response?

I am currently using NgRx Data to perform CRUD operation on couple of entities on my project. Now, I've to develop pagination. Hence, REST API response is going to be like: { "page": 1, "per_page": 10, "total": 100, "total_page":…
Kalpesh Patel
  • 259
  • 2
  • 14
4
votes
2 answers

How to avoid net::ERR_INSUFFICIENT_RESOURCES when ngrx/data is making remote api calls?

I am updating a lot of records under @ngrx/data, which calls a remote API in the background to sync the database and the local store. dataList.forEach((entity) => { const p = this.entitySvc .getEntityCollectionService(storeName) …
ed4becky
  • 1,488
  • 1
  • 17
  • 54
4
votes
2 answers

How can I customize my reducers using @ngrx/data?

I am learning to use @ngrx/data, it is true that with that library I advance a lot of code, but I am having problems when it comes to personalizing it. I already saw how to add fields to collections export const entityMetadata: EntityMetadataMap =…
Reynier Rivero
  • 2,042
  • 2
  • 8
  • 12
4
votes
1 answer

Understanding capabilities of ngrx/data

I'm trying to get familiar with ngrx/data but I'm not sure about its capabilities. I've read the documentation and some tutorials but there are still a lot of question marks: ngrx/data offers methods for CRUD functionality. But what about…
chrisch
  • 189
  • 9
3
votes
0 answers

NGRX/data how to modify / update additionalCollectionState

I am facing one issue and unable to resolve: I am using ngrx data with following: const entityMetadata: EntityMetadataMap = { forReports: { entityDispatcherOptions: { optimisticUpdate: true, }, …
Parth Developer
  • 1,371
  • 1
  • 13
  • 30
3
votes
0 answers

How can I get @ngrx/data to retrieve data only when the entityCache is empty?

I am customising an entity service in @ngrx/data, and I would like to have the store cache the data, such that it only retrieves the data from the API once, when it hasn't loaded yet, but skips any subsequent calls to the API. So far, I can't seem…
Nvveen
  • 31
  • 1
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
1 answer

How to extend ngrx/data with Entity Effects?

When converting an application to make use of ngrx state management, I decided to manage the state of some models with ngrx/data via EntityMaps. This works fine so far, however when things get a little more complex, e.g. based on fetched model data…
hreimer
  • 785
  • 8
  • 31
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
2 answers

ngrx/data error$ stream - ignore previous value

I an using ngrx/data in my app and am trying to figure out how to use the error$ stream to display an error in a component. Basically I am using a modal pop up with a form to create an entity and I am using the error$ stream to display any error…
Andrew Alderson
  • 968
  • 5
  • 16
3
votes
3 answers

Using @ngrx/data, getting "No EntityDefinition for entity type [x]"

I am trying to use @ngrx/data to create a simple service in Angular, and am receiving the error EntityDefinition for entity type "Position". when the component runs. My EntityMetadataMap is this: const entityMetaData: EntityMetadataMap = { …
CleverPatrick
  • 9,261
  • 5
  • 63
  • 86
2
votes
1 answer

What's the right version of Angular to use that supports ngRx/data?

I'm trying to build a project (https://www.learmoreseekmore.com/2021/07/ngrx-v12-an-angular-state-management-using-ngrx-data.html) that uses ngRx/data. I have the following version of Angular installed $ ng --version _ _ …
Dave
  • 15,639
  • 133
  • 442
  • 830
2
votes
1 answer

Issue using ngrx-router & ngrx-data

I am currently using ngrx in my angular 12 app. I was trying to understand how ngrx-router and ngrx-data can be used together. I have several files: app.module.ts (interesting lines) /** * Store Modules */ StoreModule.forRoot(reducers, {…
PasNinii
  • 634
  • 8
  • 18
1
2 3 4