@surface/custom-element
Version:
Provides support of directives and data binding on custom elements.
14 lines (13 loc) • 477 B
JavaScript
export const METADATA = Symbol("custom-element:metadata");
export default class Metadata {
constructor() {
this.isPropagatingCallback = false;
this.reflectingAttribute = new Set();
}
static from(target) {
if (!Reflect.has(target, METADATA)) {
Reflect.defineProperty(target, METADATA, { configurable: false, enumerable: false, value: new Metadata() });
}
return Reflect.get(target, METADATA);
}
}