angular/packages/core/rxjs-interop/test
Paul Gschwendtner 866271a1c6 refactor(core): EventEmitter implements OutputRef. (#54650)
An `EventEmitter` is a construct owned by Angular that should be
used for outputs as of right now.

As we are introducing the new `OutputRef` interface for the new output
function APIs, we also think `EventEmitter` should implement
`OutputRef`— ensuring all "known" outputs follow the same contract.

This commit ensures `EventEmitter` implements an `OutputRef`

Note: An output ref captures the destroy ref from the current injection
context for clean-up purposes. This is also done for `EventEmitter` in a
backwards compatible way:

- not requiring an injection context. EventEmitter may be used
  elsewhere.
- not cleaning up subscriptions/completing the emitter when the
  directive/component is destroyed. This would be a change in behavior.

Note 2: The dependency on `DestroyRef` causes it to be retained in all
bundling examples because ironically `NgZone` uses `EventEmitter`- not
for outputs. The code is pretty minimal though, so that should be
acceptable.

`EventEmitter` will now always retain `NgZone. This increases the
payload size slightly around 800b for AIO. Note that the other increases
were coming from previous changes. This commit just pushed it over the
threshold.

PR Close #54650
2024-03-06 12:34:39 +01:00
..
BUILD.bazel refactor: move signals code into primitives package (#51986) 2023-10-06 15:12:00 -07:00
output_from_observable_spec.ts feat(core): introduce outputFromObservable() interop function (#54650) 2024-03-06 12:34:38 +01:00
output_to_observable_spec.ts refactor(core): EventEmitter implements OutputRef. (#54650) 2024-03-06 12:34:39 +01:00
take_until_destroyed_spec.ts fix(core): ensure takeUntilDestroyed unregisters onDestroy listener on unsubscribe (#49901) 2023-04-19 19:55:09 +00:00
to_observable_spec.ts refactor(core): Synchronously emit the current signal value in toObservable (#49894) 2023-04-25 09:27:38 -07:00
to_signal_spec.ts fix(core): add rejectErrors option to toSignal (#52474) 2023-10-31 14:59:26 -07:00