Skip to content

arstrel/frontend-framework-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

frontend-framework-ts

Practise project inspired by old-school Marionette.js (for Views) and Backbone.js (for Model) Frontend framework with TypeScript

Consist of two parts:

  1. Model Classes
  • Handle data, used to represent Users, Blog, Posts, Images and so on
  1. View Classes
  • Handle the HTML and events caused by the user (like clicks)

User class

  • 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

View class

  • Handle Buttons
  • Handle clicks

Plan:

"Extraction approach:"

  1. Build the user as a "mega" class with tons of methods
  • private data
  • get(propName)
  • set(propName)
  • on(event)
  • trigger(event)
  • fetch
  • save
  1. Refactor User to use composition
  2. Refactor User to be a reusable class that can represent any piece of data, not just a User
  3. Create Collections class that can handle collection of things
  4. Views
  5. Handling DOM events
  6. Nesting DOM items

About

Frontend framework with TypeScript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published