domData.delete
Remove all data for an element previously added by set.
domData.delete(node)
Parameters
- node
{Node}
:The element.
Use
import domData from "can-dom-data";
const element = document.createElement("p");
document.body.appendChild(element);
domData.set(element, "metadata", {
hello: "world"
});
let metadata = domData.get(element, "metadata");
// metadata is {hello: "world"}
domData.delete(element, "metadata");
metadata = domData.get(element, "metadata");
// metadata === undefined after clean() was called