6
Editing Form Data
The preceding two chapters showed how to build an HTML form to add new birthdays into the Birthdays application and how to add server-side validation for that form. This chapter wraps up the form implementation by adding the ability to edit existing birthday information.
Doing this will involve adding Svelte component state to track whether the edit form is in listing or editing mode.
Up to this point, the server has stored data in a plain JavaScript array. We have been using TDD to force the simplest implementation that could possibly work. This chapter brings in a more complex implementation that uses a Map object, which we’ll do as part of the Refactor step as part of the Red-Green-Refactor workflow.
This chapter will ...
Get Svelte with Test-Driven Development now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.