@tdi2/di-core
Version:
TypeScript Dependency Injection 2 - Core DI framework
27 lines (26 loc) • 1.11 kB
JavaScript
var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
// tools/functional-di-enhanced-transformer/__tests__/__fixtures__/imported-interface.basic.transformed.snap.tsx
import React from "react";
function ImportedInterfaceComponent(props) {
const api = props.services?.api;
if (!api) {
throw new Error("Could not find implementation for 'ApiInterface'");
}
const { data } = props;
const logger = props.services?.logger;
if (!logger) {
throw new Error("Could not find implementation for 'LoggerInterface'");
}
return /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("p", null, "Data count: ", data.length), /* @__PURE__ */ React.createElement("button", {
onClick: /* @__PURE__ */ __name(() => {
logger.log("Button clicked");
api.refreshData();
}, "onClick")
}, "Refresh"));
}
__name(ImportedInterfaceComponent, "ImportedInterfaceComponent");
export {
ImportedInterfaceComponent
};
//# sourceMappingURL=imported-interface.basic.transformed.snap.js.map