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

select singleton entity from ngrx entity without id

I'm trying to implement authentication using ngrx with entity. My solution up to this point was to divide the users in the store so there is 'users' and 'user', the latter is used to track the authenticated user. Id like to be able to display the…
breadman0
  • 163
  • 1
  • 4
  • 14
0
votes
1 answer

Ngrx/effects is not working in async with angular 2

Am new to Ngrx, We got stuck with the implementation , Need some help Architecture: We are trying to fill the store when the User is authenticated by that time am trying to redirect. Expectation: Effects should be called as async and In ui we have…
0
votes
0 answers

How to check if an entity exists in store before dispatching action?

I have an avatar component used for displaying avatar of users and that component is used on multiple other components. Each avatar component tries to get the user from the server. But I am seeing a lot of actions dispatched from multiple…
Nebex Elias
  • 252
  • 1
  • 3
  • 14
0
votes
1 answer

map function not accepting stream of 'Subjects'

I am missing something obvious, but I can't see it export const subjectSelector: MemoizedSelector< any, Subject[] > = new EntitySelectorsFactory().create('subject').selectEntities; this.store.pipe( …
ed4becky
  • 1,488
  • 1
  • 17
  • 54
0
votes
1 answer

Not sure how to do a "join" in @ngrx/data

I have three entities evidence {claimId; string, subject1Id: string, subject2Id:string, claim: Claim, subject1: Subject, subject2: Subject } claim {id, ...} subject {id, ...} I am…
ed4becky
  • 1,488
  • 1
  • 17
  • 54
0
votes
1 answer

NGRX Entity State changes causes other slices to update

I have multiple EntitySates in the same slice of state. When I update with one of my entity adapters, the selector observable of the other EntityStates also gets triggered, although the selector is not accessing the updated slice of state. Is this…
praand
  • 1
  • 1
0
votes
1 answer

Sorting on the component side vs the reducer in ngrx

I'm using ngrx with angular 9 in my web app. Currently im using the sortCompare function in the reducer like this: export const adapter : EntityAdapter = createEntityAdapter({ sortComparer: sortByLastMessage }); All is good,…
Yehia A.Salam
  • 1,987
  • 7
  • 44
  • 93
0
votes
1 answer

Does ngrx selectors gets called once on initial load

It it normal for a ngrx selector to have an emitted value despite no action is dispatched at all? This console.log runs here even if no actions are dispatched in my app this.bookmarks$ = this.store.pipe( select(fromBookmarks.selectBookmarks), …
The.Wolfgang.Grimmer
  • 1,172
  • 2
  • 9
  • 32
0
votes
0 answers

ngrx entity with ActionReducerMap in Lazy Loaded Module

Can @ngrx/entity be used with ActionReducerMap in Lazy Loaded Module StoreModule.forFeature<>(). When I use it, I get below error in browser console log. ERROR TypeError: Cannot read property 'map' of undefined at ngrx-entity.js:67 at…
0
votes
1 answer

How to intercept when the action start and store is updated?

I am using NGRX. I have many actions and I want to know when actions start and when the store is updated. The idea is to have a centralized way to get the information no matter what action is executed. I need to know when the store updates without…
0
votes
1 answer

UNIT TEST JASMINE @NGRX/DATA

I am trying to write unit tests for my angular project using @ngrx/data!I get the errors Failed: Unexpected value 'EntityCollectionServiceBase' imported by the module 'DynamicTestModule'. Please add an @NgModule annotation. NullInjectorError:…
user14053020
0
votes
1 answer

how to subscribe to an Observable returned from ngrx's Entity Data Service

i have a service called TransactionEntityService derived from EntityCollectionServiceBase for a model called Transaction. export class TransactionEntityService extends EntityCollectionServiceBase { I am using TransactionDataService to…
Raas Masood
  • 1,475
  • 3
  • 23
  • 61
0
votes
1 answer

How to fix: 'TypeError: entities is not iterable' in ngRx/entity

How to fix: 'TypeError: entities not iterable' in ngRx? I am new in using ngrx functionality just referring this URL - https://www.youtube.com/watch?v=igc5rBN50wk&list=PLaMbwDs23r4KXoMucJEyUAvamQ-kFNBvC&index=7 user.effects.ts import { Injectable }…
sanny
  • 3
  • 5
0
votes
1 answer

ngrx entity upsertOne by selectId

I have the following action export const updateSuccess = createAction('Success', props<{ someId: string }>()); And I have an adapter in the reducer like this export const adapter: EntityAdapter = createEntityAdapter({ selectId:…
AngularDebutant
  • 1,436
  • 5
  • 19
  • 41
0
votes
0 answers

subscribing to observable returned from ngrx's Entity Collection Service not returning proper result

i created a service by driving my service from EntityCollectionServiceBase My entity is called Transaction. i am overriding the getAll method like this getAll(): Observable { return this.http …
Raas Masood
  • 1,475
  • 3
  • 23
  • 61