@modular-forms/qwik
Version:
The modular and type-safe form library for Qwik
22 lines (21 loc) • 627 B
JavaScript
import { getFieldArrayStore } from './getFieldArrayStore';
/**
* Returns the RAW state of the field array.
*
* @param form The form of the field array.
* @param name The name of the field array.
*
* @returns The state of the field array.
*/
export function getFieldArrayState(form, name) {
const fieldArray = getFieldArrayStore(form, name);
return fieldArray
? {
startItems: fieldArray.internal.startItems,
items: fieldArray.items,
error: fieldArray.error,
touched: fieldArray.touched,
dirty: fieldArray.dirty,
}
: undefined;
}