(isAsync: boolean = false)
| 118 | private readonly pendingTasks: PendingTasksInternal | undefined = undefined; |
| 119 | |
| 120 | constructor(isAsync: boolean = false) { |
| 121 | super(); |
| 122 | this.__isAsync = isAsync; |
| 123 | |
| 124 | // Attempt to retrieve a `DestroyRef` and `PendingTasks` optionally. |
| 125 | // For backwards compatibility reasons, this cannot be required. |
| 126 | if (isInInjectionContext()) { |
| 127 | // `DestroyRef` is optional because it is not available in all contexts. |
| 128 | // But it is useful to properly complete the `EventEmitter` if used with `outputToObservable` |
| 129 | // when the component/directive is destroyed. (See `outputToObservable` for more details.) |
| 130 | this.destroyRef = inject(DestroyRef, {optional: true}) ?? undefined; |
| 131 | this.pendingTasks = inject(PendingTasksInternal, {optional: true}) ?? undefined; |
| 132 | } |
| 133 | } |
| 134 | |
| 135 | emit(value?: any) { |
| 136 | const prevConsumer = setActiveConsumer(null); |
nothing calls this directly
no test coverage detected