MCPcopy Create free account
hub / github.com/loopbackio/loopback-next / component

Method component

packages/repository/src/mixins/repository.mixin.ts:189–198  ·  view source on GitHub ↗
(
      componentCtor: Constructor<C>,
      nameOrOptions?: string | BindingFromClassOptions,
    )

Source from the content-addressed store, hash-verified

187 // eslint-disable-next-line @typescript-eslint/ban-ts-comment
188 // @ts-ignore
189 public component<C extends Component = Component>(
190 componentCtor: Constructor<C>,
191 nameOrOptions?: string | BindingFromClassOptions,
192 ) {
193 const binding = super.component(componentCtor, nameOrOptions);
194 const instance = this.getSync<C & RepositoryComponent>(binding.key);
195 this.mountComponentRepositories(instance);
196 this.mountComponentModels(instance);
197 return binding;
198 }
199
200 /**
201 * Get an instance of a component and mount all it's

Callers

nothing calls this directly

Calls 4

getSyncMethod · 0.80
mountComponentModelsMethod · 0.80
componentMethod · 0.65

Tested by

no test coverage detected