SLB: Notes – JS: Processes
By Sol in Lab
Requirements
- 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
- Link clicked
- Click handler set on initialization
- Determine Viewer
- Iterate through component hierarchy until a Viewer is found
- Priority
- Content Item – set specifically for current item
- Group – set for group that item is in
- Default – set on View Controller as fallback Viewer
- Set “Loading” flag (Viewer)
- 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.
- Load item content
- Determine Content Type
- Load Content Type
- Run renderer for displaying Content Type
- Display Viewer
- Viewer event handlers (e.g. navigation, etc.) set as “live” events during initialization
- Content loaded
- Turn off “Loading” flag
- Start timers, etc. (for slideshow)