kompendium
Version:
Documentation generator for Stencil components
26 lines (23 loc) • 628 B
JavaScript
import { r as registerInstance, g as getElement } from './index-3601b4dc.js';
const ContextConsumer = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.context = {};
this.renderer = () => null;
}
connectedCallback() {
if (this.subscribe != null) {
this.unsubscribe = this.subscribe(this.el, 'context');
}
}
disconnectedCallback() {
if (this.unsubscribe != null) {
this.unsubscribe();
}
}
render() {
return this.renderer(Object.assign({}, this.context));
}
get el() { return getElement(this); }
};
export { ContextConsumer as context_consumer };