* 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)
| 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. |
no test coverage detected