UNPKG

@tdi2/di-core

Version:

TypeScript Dependency Injection 2 - Core DI framework

32 lines (31 loc) 1.17 kB
var __defProp = Object.defineProperty; var __name = (target, value) => __defProp(target, "name", { value, configurable: true }); // tools/functional-di-enhanced-transformer/__tests__/__fixtures__/inline-with-destructuring.basic.transformed.snap.tsx import React from "react"; function InlineWithDestructuring(props) { const api = props.services?.api; if (!api) { throw new Error("Could not find implementation for 'ApiInterface'"); } const logger = props.services?.logger; const { message } = props; if (!logger) { throw new Error("Could not find implementation for 'LoggerInterface'"); } const cache = props.services?.cache; if (!cache) { throw new Error("Could not find implementation for 'CacheInterface<any>'"); } React.useEffect(() => { api.getData().then((data) => { logger.log(`Got data: ${data.length} items`); cache.set("data", data); }); }, []); return /* @__PURE__ */ React.createElement("div", null, "Message: ", message); } __name(InlineWithDestructuring, "InlineWithDestructuring"); export { InlineWithDestructuring }; //# sourceMappingURL=inline-with-destructuring.basic.transformed.snap.js.map