Skip to content

[v2] Add a listener for array-level field changes #2300

Description

@LeCarbonator

An array field's change listener runs whenever any of its subfields changes. However, consumers may only be interested in changes to the array itself, such as moving an item, rather than changes to the values inside each item.

It would be useful to provide a dedicated listener for these array-level operations. This would let consumers react to changes in the array's structure or ordering without also handling every nested field change.

Some thoughts

One possible implementation is to trigger the listener from changes to _arrayVersion. Whether that internal value should be exposed directly or used behind a higher-level listener API is open for discussion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: runtimeThis issue affects the runtime of the library.area: typesThis issue affects the types of the library.scope: coreThis issue affects the core package, meaning any adapter is also affected by it.type: enhancementThis requests an enhancement to existing behaviour.v2This issue affects v2 as well.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions