Skip to content

Option to supply equality comparer in ObservableList #83

@mkatch

Description

@mkatch

ObservableList normalizes change records before sending the change event
https://github.com/dart-lang/observable/blob/5cb19656f0809b961a328b8f7054a0eb14071978/lib/src/observable_list.dart#L330
The actual work is done by the utility function projectListSplices, which has an optional equality parameter, but this parameter is not used by ObservableList. It would be nice to be able to control the equality comparer used for the sake of determining if the elements are equal. I imagine that an optional equality comparer parameter would be added to some of the constructors of ObservableList.

In my particular use case, I expect reference equality semantics for the purpose of determining whether the list has changed, but the concrete item type has an overridden equality operator to perform deep comparison.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions