* Update the value and notify all subscribers.
(value: T)
| 332 | * Update the value and notify all subscribers. |
| 333 | */ |
| 334 | next(value: T): void { |
| 335 | this.currentValue = value |
| 336 | for (const observer of this.observers) { |
| 337 | try { |
| 338 | observer(value) |
| 339 | } catch (error) { |
| 340 | console.error("Error in observer:", error) |
| 341 | } |
| 342 | } |
| 343 | } |
| 344 | |
| 345 | /** |
| 346 | * Get the current value without subscribing. |
no test coverage detected