Practise project inspired by old-school Marionette.js (for Views) and Backbone.js (for Model) Frontend framework with TypeScript
Consist of two parts:
- Model Classes
- Handle data, used to represent Users, Blog, Posts, Images and so on
- View Classes
- Handle the HTML and events caused by the user (like clicks)
- Represent a User and all if its data
- Needs to have the ability to store some data, retrieve it, and change it
- Needs to have the ability to notify the rest of the app when some data is changed
- User needs to bea ble to persist data to an outside server and retrieve it as some future point
- Handle Buttons
- Handle clicks
"Extraction approach:"
- Build the user as a "mega" class with tons of methods
- private data
- get(propName)
- set(propName)
- on(event)
- trigger(event)
- fetch
- save
- Refactor User to use composition
- Refactor User to be a reusable class that can represent any piece of data, not just a User
- Create Collections class that can handle collection of things
- Views
- Handling DOM events
- Nesting DOM items