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(core): form listeners #1261

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

harry-whorlow
Copy link
Contributor

Adds form listeners to formApi.

Copy link

nx-cloud bot commented Mar 9, 2025

View your CI Pipeline Execution ↗ for commit cd42633.

Command Status Duration Result
nx affected --targets=test:sherif,test:knip,tes... ❌ Failed 1m 38s View ↗
nx run-many --target=build --exclude=examples/** ❌ Failed 3s View ↗

☁️ Nx Cloud last updated this comment at 2025-03-12 11:11:37 UTC

Copy link

pkg-pr-new bot commented Mar 9, 2025

Copy link

codecov bot commented Mar 9, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.89%. Comparing base (4ef7fd1) to head (b0f47d6).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1261      +/-   ##
==========================================
+ Coverage   88.81%   88.89%   +0.08%     
==========================================
  Files          28       28              
  Lines        1269     1279      +10     
  Branches      331      331              
==========================================
+ Hits         1127     1137      +10     
  Misses        127      127              
  Partials       15       15              

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@harry-whorlow
Copy link
Contributor Author

harry-whorlow commented Mar 9, 2025

Do not merge until 'infinite type' I've fixed 🤟

Screenshot 2025-03-09 at 21 58 45

@harry-whorlow harry-whorlow marked this pull request as ready for review March 12, 2025 11:07
Comment on lines +2027 to +2039
const form = new FormApi({
defaultValues: {
items: ['one', 'two'],
age: 0,
},
listeners: {
onChange: ({ formApi, fieldName }) => {
arr = formApi.state.values[fieldName]
name = fieldName
},
},
})
form.mount()
Copy link
Contributor Author

@harry-whorlow harry-whorlow Mar 12, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need a pointer as to why fieldName is "excessively deep and possibly infinite" it will only happen when there is more than one field in the formApi.

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