ibm-js / delite

HTML Custom Element / Widget infrastructure
http://ibm-js.github.io/delite/
Other
68 stars 28 forks source link

Store, StoreMap: issues when detached / reattached #435

Closed wkeese closed 7 years ago

wkeese commented 8 years ago

See original ticket ibm-js/deliteful#589.

What should happen when a Store or StoreMap subclass is detached [and then reattached] to the document?

In any case, the current code is inconsistent and doesn't work. Store#detachedCallback() calls _untrack(), but Store has no corresponding code to requery the store and setup tracking on attachedCallback().

StoreMap#attachedCallback() does have code to call queryStoreAndInitItems(), but it doesn't run on reattach because this._pendingQuery is null.

There's also other code in StoreMap#attachedCallback() that's only meant to be run once: the code to read custom mapping attributes on the element. Probably that code should be moved to a different method.