DEV Community

Discussion on: Introducing One To Many Relationship in Angular & Akita

Collapse
 
macco3k profile image
Daniele Maccari

This is nice, but how do you manage to propagate changes back to the list in the parent entity, e.g. when editing a comment, since you have no observable? Does akita takes care of it automatically when querying?

Collapse
 
msegmx profile image
Mehmet Gunacti

From datorama.github.io/akita/docs/addi... :

const selectComments$ = this.articlesQuery
 .selectEntity(1, 'comments')
 .pipe(arrayFind([id, id, id]));
Enter fullscreen mode Exit fullscreen mode
... these observables will only fire if one of the items in the resulting collection has been modified, via an update, add or delete operation.
Enter fullscreen mode Exit fullscreen mode