Creating a new episode state

The only other piece of state that we need to consider for this UI is the new Create Episode form. Just as we track the state of the filter controls in the results state, we need to track the state of new data as it's entered so that we have it when the user clicks on the Create button:

const app = App(Map.of(
'results', Map.of(...),
'create', Map.of(
'title', '',
'director', '',
'date', '',
'rating', 0
)
);
In the previous implementation of this example, we just looked up the values that we needed directly from the form elements. There's nothing wrong with doing this, but since we're trying to keep our application state all together in one place, it would be confusing to look up some state in our App component and other state directly from DOM elements.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.105.239