dynamic-forms / Class

RemoveArrayItemEvent

Implements:FormEvent

Event dispatched to remove an item from an array field.

This event is used to dynamically remove items from array fields at runtime. The array field component listens for this event and removes the item at the specified index.

Constructor

No documentation has been provided.

Presentation
constructor(
	readonly arrayKey: string, 
	readonly index?: number | undefined
): RemoveArrayItemEvent;
Parameters
NameTypeDescription
r
arrayKey
string
r
index
number | undefined

Properties

NameTypeDescription
type
r
implements FormEvent
"remove-array-item"

Example usage

// Remove item at index 1 from 'contacts' array
eventBus.dispatch(RemoveArrayItemEvent, 'contacts', 1);

// Remove last item
eventBus.dispatch(RemoveArrayItemEvent, 'contacts');