Result state

The first piece of state that we'll look at is the episode search results. This is the focal point of the application, so this is where we'll see the most action. For example, it would make sense to store the list of all episodes here. Also, we'll want to keep track of the states of the various filter controls here:

const app = App(
Map.of(
'results', Map.of(
'episodes', List.of(
Map.of(
'title', 'The National Anthem',
'date', 'December 4 2011',
'director', 'Otto Bathurst',
'rating', 8.0
),
...
),
'query', '',
'title', true,
'director', false,
'date', false,
'rating', 7
),
)
);

Inside the results state, we have the list of episodes. We also have the filter control states. The query state is an empty string initially, because the user isn't looking for something the first time the page is rendered. The title state is true initially because we want this checkbox selected by default. The initial rating state is 7, which should be reflected visually by the rating slider.

..................Content has been hidden....................

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