yarfl
Version:
Yet Another Redux Forms Library
35 lines (34 loc) • 1.8 kB
TypeScript
import { CompleteConfig, InputValue } from '../typings';
export default class ThunkFactory {
private readonly creators;
private readonly createValidator;
private readonly createValidatorAsync;
private readonly selector;
private readonly shouldShowErrors;
private readonly shouldValidate;
constructor(config: CompleteConfig);
private validateForm;
private validateField;
private postAction;
getThunks: () => {
updateForm: (value: object) => (dispatch: any) => any;
clearForm: () => (dispatch: any) => any;
resetForm: () => (dispatch: any) => any;
validateForm: () => (dispatch: any, getState: any) => any;
showFormErrors: (showErrors?: boolean) => (dispatch: any, getState: any) => any;
updateNode: (key: string, value: object) => (dispatch: any) => any;
clearNode: (key: string) => (dispatch: any) => any;
resetNode: (key: string) => (dispatch: any) => any;
validateNode: (key: string) => (dispatch: any, getState: any) => any;
showNodeErrors: (key: string, showErrors?: boolean) => (dispatch: any) => void;
updateField: (key: string, value: InputValue) => (dispatch: any) => any;
focusField: (key: string) => (dispatch: any) => any;
blurField: (key: string) => (dispatch: any) => any;
clearField: (key: string) => (dispatch: any) => any;
resetField: (key: string) => (dispatch: any) => any;
validateField: (key: string) => (dispatch: any, getState: any) => any;
showFieldErrors: (key: string, showErrors?: boolean) => (dispatch: any) => any;
addArrayField: (key: string) => (dispatch: any, getState: any) => Promise<any[]>;
deleteArrayField: (key: string, index: number) => (dispatch: any) => any;
};
}