November 2019
Beginner
804 pages
20h 1m
English
This next method is straightforward:
removeBookCollection(identifier: string): void { if (!identifier) { throw new Error("An identifier must be provided"); } this._bookCollections.delete(identifier); this._view.removeBookCollection(identifier); this._bookService.removeMediaCollection(identifier).then(() => { console.log("Removed the collection with identifier: ", identifier); }).catch(_ => { this._view.displayErrorMessage("Failed to remove the collection!"); });}
This method first makes sure that an identifier is provided. Then, it deletes the corresponding key from the map, tells the view to remove it as well, and, finally, invokes the corresponding service method.
In the event of an error, ...
Read now
Unlock full access