Semantic Dom Diff
Part of Open Web Component Recommendation open-wc
We want to provide a good set of default on how to facilitate your web component.
Manual Setup
yarn add @open-wc/semantic-dom-diff --dev
Basics
import { getSemanticDomDiff } from '@open-wc/semantic-dom-diff';
const leftTree = `
<div>foo</div>
`;
const rightTree = `
<div>bar</div>
`;
// Diff will be an object if there is a difference, otherwise undefined
const diff = getSemanticDomDiff(leftTree, rightTree);