Enhancements
The Create method has a potential problem in that it assumes that it succeeds immediately. It does not handle the success event for the operation. Additionally, there is a further issue in that add operations have a complete event because the success event may fire before the record has been successfully written to the disk, and, if the transaction fails, the complete event is not raised. You can convert the Create method so that it uses a promise and resumes processing when the success event is raised. Then, update the insert portion of the component to reload once this has been completed.
The deletion resets the state even if the user wasn't editing the record that was deleted. So, enhance the delete code to only reset the ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access