Add notification and handler for metadata update

This commit is contained in:
aditya.chandel
2025-01-10 17:37:35 -07:00
parent 3407caeb5f
commit 41e59b39ca
8 changed files with 95 additions and 50 deletions
@@ -205,4 +205,12 @@ export class BookService {
})
);
}
handleUpdateMetadata(updatedBook: Book) {
const currentState = this.bookStateSubject.value;
const updatedBooks = (currentState.books || []).map(book => {
return book.id == updatedBook.id ? {...book, metadata: updatedBook.metadata} : book
});
this.bookStateSubject.next({...currentState, books: updatedBooks})
}
}