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

test: add util to type-safely set signal inputs #877

Merged

Conversation

davidlj95
Copy link
Owner

After using input signals in most components around, now to set those inputs the componentRef.setInput function is used.

However, that function is not type-safe. So:

  • Name may be wrong: one can make a typo and nothing would happen
  • Value type may be wrong
  • Refactoring: if at some point the name of the component input property to set changes, it would need a manual update

Introducing here a set of type-safe APIs that use the main API under the hood. To allow easy refactoring and type checks for the name and value type to set.

Copy link
Owner Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

Copy link

codecov bot commented Nov 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.99%. Comparing base (303a4bc) to head (f7c2cae).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #877      +/-   ##
==========================================
+ Coverage   95.95%   95.99%   +0.03%     
==========================================
  Files         123      124       +1     
  Lines         618      624       +6     
  Branches       70       70              
==========================================
+ Hits          593      599       +6     
  Misses         19       19              
  Partials        6        6              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

one without triggering cd, the other with
@davidlj95 davidlj95 enabled auto-merge (squash) November 27, 2024 20:16
@davidlj95 davidlj95 merged commit 298c970 into main Nov 27, 2024
15 checks passed
@davidlj95 davidlj95 deleted the stacked/test-add-util-to-type-safely-set-signal-inputs branch November 27, 2024 20:17
Copy link

🚀 This pull request is included in v2.63.2. See v2.63.2 for release notes.

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.

1 participant