Closed luv2code closed 2 years ago
In the store doc page, the code figure reads like this:
export default function MyElement({ html, state }) { const { attrs, store } = state const { message='', bookId='' } = attrs const { books={} } = store const book = books.bookId const bookTitle = book.title || '' return html` <div> <h3>${bookTitle}</h3> </div> ` }
I believe it should read like so (using the bookId string to index into the books store object):
export default function MyElement({ html, state }) { const { attrs, store } = state const { message='', bookId='' } = attrs const { books={} } = store const book = books[bookId] const bookTitle = book.title || '' return html` <div> <h3>${bookTitle}</h3> </div> ` }
Totally, another excellent find. Thank you, this will be live in a few minutes!
In the store doc page, the code figure reads like this:
I believe it should read like so (using the bookId string to index into the books store object):