Advanced Angular Project Structure

  • Concept of Editors
    • DisplayComponent - Viewing and Interaction
    • EditorComponent - Has temp data waiting to be saved
  • Data stores
    • Domain Stores
    • Editor Stores
    • Active Items Stores
    • Master Editor Stores - init(), isReady(), commit()
  • Interacting with data stores
    • Data store data initial loading - Zone
    • Data store data update data via interaction - Observable

Data loading:

  • Domain store - domain store data is loaded on creation (fetch data for one domain)
  • Master editor store - data is loaded on demand - when the editor is launched (fetch data for multi-domains)
  • Editor stores - Master editor store load data, then set into editor stores (set store per domain)

Mappings:

  • Each store maps to one domain only

Component:

  • May use multiple domains from multiple stores
  • Use class variable to keep a copy of the whole store(s), each per domain
  • Using data - Have methods to combine multi-stores to get data // auto-refreshed when observable.next(store) is called
  • Updating data - Have methods to update stores and call refresh // refresh == observable.next(store)

results matching ""

    No results matching ""