react-validatables
Advanced tools
Comparing version 1.0.0-alpha.8 to 1.0.0-alpha.9
@@ -0,1 +1,2 @@ | ||
import type { DependencyList } from 'react'; | ||
import type { BindingArrayDependencies, LimiterOptions, ReadonlyBinding } from 'react-bindings'; | ||
@@ -5,2 +6,4 @@ export interface UseValidatorArgs extends LimiterOptions { | ||
id?: string; | ||
/** On a rerender, deps changes are treated like hard reset bindings changes. */ | ||
deps?: DependencyList; | ||
/** | ||
@@ -7,0 +10,0 @@ * If specified and the values of any of the specified bindings are not truthy, the validator is disabled and so it will always result in |
@@ -16,3 +16,3 @@ import { InferRequiredWaitableAndBindingValueTypes, TypeOrPromisedType, WaitableDependencies } from 'react-waitables'; | ||
*/ | ||
export declare const useValidator: <DependenciesT extends WaitableDependencies>(dependencies: DependenciesT | undefined, validators: (dependencyValues: InferRequiredWaitableAndBindingValueTypes<DependenciesT>, dependencies: DependenciesT, args: ValidationCheckerArgs) => TypeOrPromisedType<ValidationChecker<InferRequiredWaitableAndBindingValueTypes<DependenciesT>> | undefined>, { id, disabledUntil: disabledUntilBindings, disabledWhile: disabledWhileBindings, disabledWhileUnmodified: disabledWhileUnmodifiedBindings, limitMSec, limitMode, limitType, priority, queue }?: UseValidatorArgs) => Validator; | ||
export declare const useValidator: <DependenciesT extends WaitableDependencies>(dependencies: DependenciesT | undefined, validators: (dependencyValues: InferRequiredWaitableAndBindingValueTypes<DependenciesT>, dependencies: DependenciesT, args: ValidationCheckerArgs) => TypeOrPromisedType<ValidationChecker<InferRequiredWaitableAndBindingValueTypes<DependenciesT>> | undefined>, { id, deps, disabledUntil: disabledUntilBindings, disabledWhile: disabledWhileBindings, disabledWhileUnmodified: disabledWhileUnmodifiedBindings, limitMSec, limitMode, limitType, priority, queue }?: UseValidatorArgs) => Validator; | ||
//# sourceMappingURL=use-validator.d.ts.map |
@@ -33,3 +33,3 @@ "use strict"; | ||
*/ | ||
const useValidator = (dependencies, validators, { id = 'validator', disabledUntil: disabledUntilBindings, disabledWhile: disabledWhileBindings, disabledWhileUnmodified: disabledWhileUnmodifiedBindings, | ||
const useValidator = (dependencies, validators, { id = 'validator', deps, disabledUntil: disabledUntilBindings, disabledWhile: disabledWhileBindings, disabledWhileUnmodified: disabledWhileUnmodifiedBindings, | ||
// LimiterOptions | ||
@@ -75,5 +75,6 @@ limitMSec, limitMode, limitType, priority, queue } = {}) => { | ||
} | ||
}), Object.assign({ id, addFields: () => ({ isDisabled }), hardResetBindings: isDisabledBinding, defaultValue: () => (isDisabled() ? basic_validation_results_1.disabledState : undefined) }, limiterOptions)); | ||
}), Object.assign({ id, | ||
deps, addFields: () => ({ isDisabled }), hardResetBindings: isDisabledBinding, defaultValue: () => (isDisabled() ? basic_validation_results_1.disabledState : undefined) }, limiterOptions)); | ||
}; | ||
exports.useValidator = useValidator; | ||
//# sourceMappingURL=use-validator.js.map |
{ | ||
"name": "react-validatables", | ||
"version": "1.0.0-alpha.8", | ||
"version": "1.0.0-alpha.9", | ||
"description": "Validation tools for React built on react-waitables", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
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
151880
1533