@@ -49,7 +49,7 @@ const filterIssuesByPath = (
|
|||||||
issue.path.length >= path.length && Array.every(path, (p, i) => p === issue.path[i])
|
issue.path.length >= path.length && Array.every(path, (p, i) => p === issue.path[i])
|
||||||
)
|
)
|
||||||
|
|
||||||
export const focusObjectField: {
|
export const focusObjectOn: {
|
||||||
<P extends readonly PropertyKey[], A extends object, I extends object, ER, EW, K extends keyof A & keyof I>(
|
<P extends readonly PropertyKey[], A extends object, I extends object, ER, EW, K extends keyof A & keyof I>(
|
||||||
self: Form<P, A, I, ER, EW>,
|
self: Form<P, A, I, ER, EW>,
|
||||||
key: K,
|
key: K,
|
||||||
@@ -67,7 +67,7 @@ export const focusObjectField: {
|
|||||||
return new FormImpl(
|
return new FormImpl(
|
||||||
path,
|
path,
|
||||||
Subscribable.mapOption(form.value, a => a[key]),
|
Subscribable.mapOption(form.value, a => a[key]),
|
||||||
Lens.focusObjectField(form.encodedValue, key),
|
Lens.focusObjectOn(form.encodedValue, key),
|
||||||
Subscribable.map(form.issues, issues => filterIssuesByPath(issues, path)),
|
Subscribable.map(form.issues, issues => filterIssuesByPath(issues, path)),
|
||||||
form.isValidating,
|
form.isValidating,
|
||||||
form.canCommit,
|
form.canCommit,
|
||||||
|
|||||||
Reference in New Issue
Block a user