effex-monorepo
    Preparing search index...

    Interface MapFieldState<K, V, EntryState>

    Runtime state for a map field. Provides map manipulation and access to individual entry states.

    interface MapFieldState<K, V, EntryState = any> {
        clear: () => Effect<void>;
        delete: (key: K) => Effect<boolean>;
        dirty: Readable.Readable<boolean>;
        entries: Readable.Readable<ReadonlyMap<K, EntryState>>;
        errors: Readable.Readable<readonly ParseIssue[]>;
        getEntry: (key: K) => Effect<EntryState | undefined>;
        reset: () => Effect<void>;
        set: (
            value: ReadonlyMap<K, V> | Iterable<readonly [K, V], any, any>,
        ) => Effect<void>;
        setEntry: (key: K, value: V) => Effect<void>;
        size: Readable.Readable<number>;
        touched: Readable.Readable<boolean>;
        update: (
            f: (
                value: ReadonlyMap<K, V>,
            ) => ReadonlyMap<K, V> | Iterable<readonly [K, V], any, any>,
        ) => Effect<void>;
        value: Readable.Readable<ReadonlyMap<K, V>>;
    }

    Type Parameters

    • K
    • V
    • EntryState = any
    Index

    Properties

    clear: () => Effect<void>

    Remove all entries

    delete: (key: K) => Effect<boolean>

    Delete an entry by key

    dirty: Readable.Readable<boolean>

    Whether any map entry has changed from initial

    entries: Readable.Readable<ReadonlyMap<K, EntryState>>

    Access individual entry field states by key

    errors: Readable.Readable<readonly ParseIssue[]>

    Validation errors for the map as a whole (aggregated from entries)

    getEntry: (key: K) => Effect<EntryState | undefined>

    Get field state for a specific key

    reset: () => Effect<void>

    Reset the map to initial values

    set: (
        value: ReadonlyMap<K, V> | Iterable<readonly [K, V], any, any>,
    ) => Effect<void>

    Set the entire map value

    setEntry: (key: K, value: V) => Effect<void>

    Set a single entry value (creates entry state if new)

    size: Readable.Readable<number>

    Reactive size of the map

    touched: Readable.Readable<boolean>

    Whether any map entry has been touched

    update: (
        f: (
            value: ReadonlyMap<K, V>,
        ) => ReadonlyMap<K, V> | Iterable<readonly [K, V], any, any>,
    ) => Effect<void>

    Update the map value with a function

    value: Readable.Readable<ReadonlyMap<K, V>>

    The map's current values as a readable