I'm setting some metadata as attributes on my elements and I don't want it to be rendered in the template. So the idea is to use a custom morphAttrs function to filter out undesired attributes on the check.
I believe it's easy to update, we just need to export morphAttrs and morphdomFactory on the index.js file.
-- Edit --
Or maybe we can only provide a callback function to filter the attributes of toNode. I just cloned the repo and changed this line in the morphAttrs function and it's working as I wanted.
export default function morphAttrs(fromNode, toNode) {
var toNodeAttrs = Array.from(toNode.attributes).filter(
attr => !attr.name.includes('on:') && attr.name !== 'key' // filter out my metadata
)
var attr
...
I'm setting some metadata as attributes on my elements and I don't want it to be rendered in the template. So the idea is to use a custom
morphAttrs
function to filter out undesired attributes on the check.I believe it's easy to update, we just need to export
morphAttrs
andmorphdomFactory
on the index.js file.-- Edit --
Or maybe we can only provide a callback function to filter the attributes of
toNode
. I just cloned the repo and changed this line in themorphAttrs
function and it's working as I wanted.