Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): expose new
output()
API (#54650)
This commit exposes the new `output()` API with numerous benefits: - Symmetrical API to `input()`, `model()` etc. - Fixed types for `EventEmitter.emit`— current `emit` method of `EventEmitter` is broken and accepts `undefined` via `emit(value?: T)` - Removal of RxJS specific concepts from outputs. error channels, completion channels etc. We now have a simple consistent interface. - Automatic clean-up of subscribers upon directive/component destory- when subscribed programmatically. ```ts @directive({..}) export class MyDir { nameChange = output<string>(); // OutputEmitterRef<string> onClick = output(); // OutputEmitterRef<void> } ``` Note: RxJS custom observable cases will be handled in future commits via explicit helpers from the interop. PR Close #54650
- Loading branch information
1 parent
9ce6277
commit c687b8f
Showing
9 changed files
with
52 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1670,6 +1670,9 @@ | |
{ | ||
"name": "init_output" | ||
}, | ||
{ | ||
"name": "init_output_emitter_ref" | ||
}, | ||
{ | ||
"name": "init_partial" | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1989,7 +1989,7 @@ | |
"name": "tap" | ||
}, | ||
{ | ||
"name": "throwError" | ||
"name": "throwError2" | ||
}, | ||
{ | ||
"name": "throwIfEmpty" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters