SLB: Notes – JS: Processes

By Sol in Lab


  • Do as little as possible at any given time (only what is necessary)
    • e.g. Parse theme tags only when displaying theme, not during initialization, etc.
  • Safe data access – Component instance data always accessible
  • Cache component instance data/properties
    • If something is parsed or processed, the result should be cached for future access

Displaying Content Item

  1. Link clicked
    • Click handler set on initialization
  2. Determine Viewer
    • Iterate through component hierarchy until a Viewer is found
    • Priority
      1. Content Item – set specifically for current item
      2. Group – set for group that item is in
      3. Default – set on View Controller as fallback Viewer
  3. Set “Loading” flag (Viewer)
  4. Load Viewer Theme
    • Insert Theme layout into DOM (if not previously done)
    • Parse Theme layout
      • Static tags – UI, labels, etc.
      • Dynamic tags: Item data, etc.
  5. Load item content
    • Determine Content Type
    • Load Content Type
    • Run renderer for displaying Content Type
  6. Display Viewer
    • Viewer event handlers (e.g. navigation, etc.) set as “live” events during initialization
  7. Content loaded
  8. Turn off “Loading” flag
  9. Start timers, etc. (for slideshow)