From 104d1b226c04cb2f12541081d1159b12dc431b1e Mon Sep 17 00:00:00 2001 From: kj Date: Fri, 17 Nov 2023 16:33:51 -0800 Subject: [PATCH] closes #171 --- app/docs/md/conventions/browser.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/app/docs/md/conventions/browser.md b/app/docs/md/conventions/browser.md index af64617d..e4414a1a 100644 --- a/app/docs/md/conventions/browser.md +++ b/app/docs/md/conventions/browser.md @@ -77,7 +77,7 @@ Write a pure function for returning the HTML markup for the `my-message.mjs` cus ```javascript export default function MyMessage({ html, state }) { - const { attrs=[] } = state + const { attrs={} } = state const { message='' } = attrs return html`

${ message }

` @@ -117,12 +117,7 @@ class MyMessageElement extends HTMLElement { } html(strings, ...values) { - const collect = [] - for (let i = 0; i < strings.length - 1; i++) { - collect.push(strings[i], values[i]) - } - collect.push(strings[strings.length - 1]) - return collect.join('') + return String.raw({ raw: strings }, ...values) } static get observedAttributes() {