Learning object 55 of 100
Responsive application preview
Run a small, complete application at phone, tablet and full widths, and inspect how its layers fit together: config, state, logic, components, persistence and start-up.
Loading…
What it shows
A maintainable browser application keeps configuration in one place, rules in pure functions, views in components that receive what they need, and storage behind a small interface that handles errors. Responsive CSS lets the same markup work from phone to desktop. Looking at the app at different widths and reading its structure shows how the pieces connect.
Guided experiment
- Switch between the widths. Which layout rule changes the card grid?
- Mark a habit as done, then run again. Is it remembered?
- Find the one place where the storage key is defined.
Predict
Why pass the storage object into startApp instead of using localStorage inside it?
Related
Lessons: Lesson 75: Building maintainable browser applications
Projects: Project 9: Shopping Cart Price Calculator
Source: web/assets/js/objects/object-055.js in the companion repository.