use-state-validate
Advanced tools
Comparing version 0.0.1 to 0.0.2
@@ -1,3 +0,13 @@ | ||
import { IUseStateValidate } from "types"; | ||
interface IStateWithValidation<T> { | ||
value: T; | ||
isDirty: boolean; | ||
isValid: boolean; | ||
errorMessages: string[]; | ||
} | ||
export interface IUseStateValidate<T> extends Array<IStateWithValidation<T> | T | ((newValue: T) => void)> { | ||
0: IStateWithValidation<T>; | ||
1: (newValue: T) => void; | ||
2: () => void; | ||
} | ||
export declare const useStateValidate: <T>(initial: T, rules: object) => IUseStateValidate<T>; | ||
export default useStateValidate; |
{ | ||
"name": "use-state-validate", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Custom hook to account for state and validation off single state value", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
8566
5
13