MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / refresh

Method refresh

packages/context/src/binding.ts:451–459  ·  view source on GitHub ↗

* Invalidate the binding cache so that its value will be reloaded next time. * This is useful to force reloading a cached value when its configuration or * dependencies are changed. * **WARNING**: The state held in the cached value will be gone. * * @param ctx - Context object

(ctx: Context)

Source from the content-addressed store, hash-verified

449 * @param ctx - Context object
450 */
451 refresh(ctx: Context) {
452 if (!this._cache) return;
453 if (this.scope !== BindingScope.TRANSIENT) {
454 const resolutionCtx = ctx.getResolutionContext(this);
455 if (resolutionCtx != null) {
456 this._cache.delete(resolutionCtx);
457 }
458 }
459 }
460
461 /**
462 * This is an internal function optimized for performance.

Callers 2

context.unit.tsFile · 0.45

Calls 2

deleteMethod · 0.65
getResolutionContextMethod · 0.45

Tested by

no test coverage detected