UNPKG

lynx-form-x

Version:

LynxFormX is a lightweight and intuitive form library built for the Lynx framework for mobile development. It streamlines form management by automatically binding fields, handling validation, and providing easy-to-use hooks for custom field manipulation—a

7 lines (6 loc) • 606 B
import { ActionType } from './formReducer.jsx'; export const setIsSubmitting = (dispatch, isSubmitting) => dispatch({ type: ActionType.SET_IS_SUBMITTING, isSubmitting }); export const setValue = (dispatch, field, value) => dispatch({ type: ActionType.SET_VALUE, field, value }); export const setError = (dispatch, field, error) => dispatch({ type: ActionType.SET_ERROR, field, error }); export const setTouched = (dispatch, field, touched) => dispatch({ type: ActionType.SET_TOUCHED, field, touched }); export const reset = (dispatch, initialValues) => dispatch({ type: ActionType.RESET, initialValues });