UNPKG

@modular-forms/qwik

Version:

The modular and type-safe form library for Qwik

17 lines (16 loc) 595 B
import { initializeFieldArrayStore } from './initializeFieldArrayStore'; /** * Sets the store of a field array to the specified state. * * @param form The form of the field array. * @param name The name of the field array. * @param state The new state to be set. */ export function setFieldArrayState(form, name, state) { const fieldArray = initializeFieldArrayStore(form, name); fieldArray.internal.startItems = state.startItems; fieldArray.items = state.items; fieldArray.error = state.error; fieldArray.touched = state.touched; fieldArray.dirty = state.dirty; }