MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / Injector

Class Injector

code/dependency-injection-module-system/src/di.jsx:16–30  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15export function wire(Component, deps, mapper) {
16 return class Injector extends React.Component {
17 constructor(props) {
18 super(props);
19 this._resolvedDependencies = mapper(...deps.map(fetch));
20 }
21 render() {
22 return (
23 <Component
24 {...this.state}
25 {...this.props}
26 {...this._resolvedDependencies}
27 />
28 );
29 }
30 };
31}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected