cgrand / enlivez

8 stars 0 forks source link

Main algorithm #13

Closed cgrand closed 5 years ago

cgrand commented 5 years ago

Reminder: template is to component what class is to object.

  1. Retrieve all queries from the template hierarchy
  2. Instantiate the root component (technical root component no matching DOM)
  3. Run queries derivatives, for each upsert row, traverse the component tree until matching (key-wise) component is found
    1. If found, update the component
    2. If not found, instantiate all missing components (using children template information from the last traversed component)
    3. for each delta row, traverse the component tree until matching (key-wise) component is found and remove it (retract state entity too)