- From: Jan Miksovsky <notifications@github.com>
- Date: Mon, 18 Dec 2017 09:39:09 -0800
- To: w3c/webcomponents <webcomponents@noreply.github.com>
- Cc: Subscribed <subscribed@noreply.github.com>
Received on Monday, 18 December 2017 17:39:31 UTC
@rniwa and I had a chance to talk about this last week. He was not in favor of most of my suggestions, although as he notes above, he is in favor of having a template's `instantiate()` call return a new type of object that's not an `HTMLTemplateElement`. For now, let's say it's something like `HTMLUpdatableInstance`. This would have a `content` property that holds the document fragment, and an `update` method for updating those nodes. ```js const instance = template.instantiate(); document.body.appendChild(instance.content); instance.update({ name: 'Jane' }); ``` To me, at least, having this result be a distinct class feels better. Among other things, it means that `HTMLTemplateElement` doesn't get burdened with the notion of updatability. With such an object returned by `instantiate()`, I believe I could still get destructuring along the lines shown above: ```js const { content, update } = template.instantiate(); document.body.appendChild(content); update({ name: 'Jane' }); ``` -- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/w3c/webcomponents/issues/685#issuecomment-352499678
Received on Monday, 18 December 2017 17:39:31 UTC