effex-monorepo
    Preparing search index...

    Interface ArrayFieldState<T, ItemState>

    Runtime state for an array field. Provides array manipulation and access to individual item states.

    interface ArrayFieldState<T, ItemState = any> {
        clear: () => Effect<void>;
        dirty: Readable.Readable<boolean>;
        errors: Readable.Readable<readonly ParseIssue[]>;
        insertAt: (index: number, item: T) => Effect<void>;
        items: Readable.Readable<readonly ItemState[]>;
        length: Readable.Readable<number>;
        move: (fromIndex: number, toIndex: number) => Effect<void>;
        pop: () => Effect<void>;
        push: (...items: T[]) => Effect<void>;
        removeAt: (index: number) => Effect<void>;
        reset: () => Effect<void>;
        set: (value: readonly T[]) => Effect<void>;
        shift: () => Effect<void>;
        touched: Readable.Readable<boolean>;
        unshift: (...items: T[]) => Effect<void>;
        update: (f: (value: readonly T[]) => readonly T[]) => Effect<void>;
        value: Signal.Signal<readonly T[]>;
    }

    Type Parameters

    • T
    • ItemState = any
    Index

    Properties

    clear: () => Effect<void>

    Remove all elements from the array

    dirty: Readable.Readable<boolean>

    Whether any array item has changed from initial

    errors: Readable.Readable<readonly ParseIssue[]>

    Validation errors for the array as a whole (aggregated from items)

    insertAt: (index: number, item: T) => Effect<void>

    Insert an element at a specific index

    items: Readable.Readable<readonly ItemState[]>

    Access individual item field states

    length: Readable.Readable<number>

    Reactive length of the array

    move: (fromIndex: number, toIndex: number) => Effect<void>

    Move an element from one index to another

    pop: () => Effect<void>

    Remove and return the last element

    push: (...items: T[]) => Effect<void>

    Add one or more elements to the end

    removeAt: (index: number) => Effect<void>

    Remove the element at a specific index

    reset: () => Effect<void>

    Reset the array to initial values

    set: (value: readonly T[]) => Effect<void>

    Set the entire array value

    shift: () => Effect<void>

    Remove and return the first element

    touched: Readable.Readable<boolean>

    Whether any array item has been touched

    unshift: (...items: T[]) => Effect<void>

    Add one or more elements to the beginning

    update: (f: (value: readonly T[]) => readonly T[]) => Effect<void>

    Update the array value with a function

    value: Signal.Signal<readonly T[]>

    The array's current values as a signal