UNPKG

@visactor/openinula-vchart

Version:

The openinula version of VChart 4.x

25 lines (20 loc) 886 B
"use strict"; var __importDefault = this && this.__importDefault || function(mod) { return mod && mod.__esModule ? mod : { default: mod }; }; Object.defineProperty(exports, "__esModule", { value: !0 }), exports.withChartInstance = void 0; const openinula_1 = __importDefault(require("openinula")), ChartContext = openinula_1.default.createContext(null); function withChartInstance(Component) { const Com = openinula_1.default.forwardRef(((props, ref) => openinula_1.default.createElement(ChartContext.Consumer, null, (ctx => openinula_1.default.createElement(Component, Object.assign({ ref: ref, chart: ctx.chart }, props)))))); return Com.displayName = Component.name, Com; } ChartContext.displayName = "ChartContext", exports.withChartInstance = withChartInstance, exports.default = ChartContext; //# sourceMappingURL=chart.js.map