MCPcopy
hub / github.com/loopbackio/loopback-next / apply

Method apply

packages/context/src/binding.ts:967–972  ·  view source on GitHub ↗

* Apply one or more template functions to set up the binding with scope, * tags, and other attributes as a group. * * @example * ```ts * const serverTemplate = (binding: Binding) => * binding.inScope(BindingScope.SINGLETON).tag('server'); * * const serverBinding = new Bindi

(...templateFns: BindingTemplate<T>[])

Source from the content-addressed store, hash-verified

965 * @param templateFns - One or more functions to configure the binding
966 */
967 apply(...templateFns: BindingTemplate<T>[]): this {
968 for (const fn of templateFns) {
969 fn(this);
970 }
971 return this;
972 }
973
974 /**
975 * Convert to a plain JSON object

Callers 15

toInjectableMethod · 0.95
addExtensionFunction · 0.80
serverMethod · 0.80
onInitMethod · 0.80
onStartMethod · 0.80
onStopMethod · 0.80
componentMethod · 0.80
lifeCycleObserverMethod · 0.80
createServiceBindingFunction · 0.80
service.unit.tsFile · 0.80
lifecycle.unit.tsFile · 0.80

Calls 1

fnFunction · 0.50

Tested by 7

givenObserverFunction · 0.64
givenAsyncObserverFunction · 0.64
inspectScopeAndTagsFunction · 0.64
givenGlobalInterceptorFunction · 0.64
givenAClientFunction · 0.64
configureApplicationFunction · 0.64