Repository navigation
docs: illustrate how to check validity - #16186
Conversation
|
| ``` | ||
|
|
||
| As with individual fields, `createPost.fields.allIssues()` will return `undefined` if the form as a whole is valid (or has not yet been validated). | ||
|
|
There was a problem hiding this comment.
How about adding one more sentence (or note) saying negating allIssues() can be used to get the validity of the form. This echoes suggestion here by teemingc: #16080 (comment) and prevents people from looking for isValid() in the first place. What do you think?
There was a problem hiding this comment.
I typically am not in favor of documenting how JavaScript works -- everyone who reads this should probably know that you can either negate this or compare it to undefined
There was a problem hiding this comment.
agree with that sentiment
…ds.branch.leaf` has issues (#16187) Companion to #16186 — right now we return an empty array when `undefined` is more helpful. Small/edgey enough that I didn't think it warranted a test --- ### Please don't delete this checklist! Before submitting the PR, please make sure you do the following: - [x] It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs - [x] This message body should clearly illustrate what problems it solves. - [ ] Ideally, include a test that fails without this PR but passes with it. ### Tests - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint` and `pnpm check` ### Changesets - [x] If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running `pnpm changeset` and following the prompts. Changesets that add features should be `minor` and those that fix bugs should be `patch`. Please prefix changeset messages with `feat:`, `fix:`, or `chore:`. ### Edits - [x] Please ensure that 'Allow edits from maintainers' is checked. PRs without this option may be closed. --------- Co-authored-by: Tee Ming <[email protected]> Co-authored-by: vercel[bot] <35613825+vercel[bot]@users.noreply.github.com> Co-authored-by: Vercel <vercel[bot]@users.noreply.github.com>
alternative to #16137