mutate() original state / source restoration improvements
-
Should restoration only work on remember(name pending, mayberecall) class/attrib elements?
WeakMap (node as key)
- Removes need for ID, uses node itself as key
-
👍 Allows for garbage collection -
❔ Enforces 1:1 original source ID -
❌ DOM.resetless performant (have to WeakMap.get all potential elements)
Data attribute + array
-
👍 Super fast reset viaquerySelectorAll('[data-osid]')reference -
❔ Allows for 'duplication' of OS content by copying OSID references -
❌ No cleanup if element is permanently removed -
❌ Dirtys DOM (see #103)
DOM node property + array
-
👍 Does not dirty visible DOM -
❌ Chance of prop collision (but low due topd_naming convention)
Misc
-
Rename OSID if appropriate. - renamed to originalState
-
Rename to initialStateif we don't allow replacement of original?
Edited by Lorin Halpert