@tanstack/form-core
Advanced tools
Comparing version 0.34.0 to 0.34.1
@@ -216,2 +216,3 @@ import { Store } from '@tanstack/store'; | ||
prevState: FieldState<TData>; | ||
timeoutIds: Record<ValidationCause, ReturnType<typeof setTimeout> | null>; | ||
/** | ||
@@ -218,0 +219,0 @@ * Initializes a new `FieldApi` instance. |
@@ -215,3 +215,6 @@ import { Store } from "@tanstack/store"; | ||
rawError = await new Promise((rawResolve, rawReject) => { | ||
setTimeout(async () => { | ||
if (this.timeoutIds[validateObj.cause]) { | ||
clearTimeout(this.timeoutIds[validateObj.cause]); | ||
} | ||
this.timeoutIds[validateObj.cause] = setTimeout(async () => { | ||
if (controller.signal.aborted) return rawResolve(void 0); | ||
@@ -320,2 +323,3 @@ try { | ||
this.name = opts.name; | ||
this.timeoutIds = {}; | ||
if (opts.defaultValue !== void 0) { | ||
@@ -322,0 +326,0 @@ this.form.setFieldValue(this.name, opts.defaultValue, { |
@@ -105,2 +105,3 @@ import { Store } from "@tanstack/store"; | ||
fieldValidationPromises.push( | ||
// Remember, `validate` is either a sync operation or a promise | ||
Promise.resolve().then(() => fieldInstance.validate(cause)) | ||
@@ -107,0 +108,0 @@ ); |
{ | ||
"name": "@tanstack/form-core", | ||
"version": "0.34.0", | ||
"version": "0.34.1", | ||
"description": "Powerful, type-safe, framework agnostic forms.", | ||
@@ -5,0 +5,0 @@ "author": "tannerlinsley", |
@@ -435,2 +435,3 @@ import { Store } from '@tanstack/store' | ||
prevState!: FieldState<TData> | ||
timeoutIds: Record<ValidationCause, ReturnType<typeof setTimeout> | null> | ||
@@ -451,3 +452,3 @@ /** | ||
this.name = opts.name as never | ||
this.timeoutIds = {} as Record<ValidationCause, never> | ||
if (opts.defaultValue !== undefined) { | ||
@@ -896,3 +897,7 @@ this.form.setFieldValue(this.name, opts.defaultValue as never, { | ||
rawError = await new Promise((rawResolve, rawReject) => { | ||
setTimeout(async () => { | ||
if (this.timeoutIds[validateObj.cause]) { | ||
clearTimeout(this.timeoutIds[validateObj.cause]!) | ||
} | ||
this.timeoutIds[validateObj.cause] = setTimeout(async () => { | ||
if (controller.signal.aborted) return rawResolve(undefined) | ||
@@ -899,0 +904,0 @@ try { |
@@ -587,2 +587,3 @@ import { Store } from '@tanstack/store' | ||
fieldValidationPromises.push( | ||
// Remember, `validate` is either a sync operation or a promise | ||
Promise.resolve().then(() => fieldInstance.validate(cause)), | ||
@@ -589,0 +590,0 @@ ) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
469373
6226