Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(spectator): support for Function-based outputs #671

Conversation

anatolie-darii
Copy link
Contributor

@anatolie-darii anatolie-darii commented Sep 10, 2024

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Documentation content changes
[ ] Other... Please describe:

What is the current behavior?

currently there are a couple of issues with spectator.output

  1. Unless you add a specific return type then it returns an Observable<unknown>
  2. Doesn't support function based outputs (https://angular.dev/guide/components/output-fn#)

What is the new behavior?

  1. Added 2 additional overloads for the output method
  • one very similar to the existing one but with the return type OutputEmitterRef<T>
  • one that infers the return type based on the key name.
  1. Limit the output names at compile time to field names that are of an output type

Does this PR introduce a breaking change?

[ ] Yes
[x] No

Copy link

stackblitz bot commented Sep 10, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@NetanelBasal NetanelBasal merged commit 02ed01d into ngneat:master Sep 11, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants