Skip to content

Refactor

Choose a tag to compare

@colinaut colinaut released this 06 Aug 03:24
· 20 commits to main since this release

Refactored the code to clean it up, make it smaller, and speed up initial render.

  • Uses WeakMap for handling data associated with cells, rather than saving as custom properties on the td DOM elements themselves. While not the latter works, I switched to using a WeakMap as it is a better approach.
  • Uses a Set for managing which rows are visible due to filtering, rather than a custom property on the tr.
  • Caches cell sort/filter content (in WeakMap) as needed for sort/filter requests, rather than scanning the DOM for every table cell on initialization. This speeds up initial render, especially for large tables.