Closed leoafarias closed 2 months ago
Do we need unordered list/set comparisons? Or just have a method to pass in that can override this implementation?
@rodydavis overriding will be your call. Initially I am trying to kep it consistent with flutter foundation
library.
set: https://api.flutter.dev/flutter/foundation/setEquals.html map: https://api.flutter.dev/flutter/foundation/mapEquals.html list: https://api.flutter.dev/flutter/foundation/listEquals.html
Works for me! I was meaning like a static override on the class but could be added in a later PR
Also we can make the members public so the class can be extended and overridden.
Maybe the name could be prefixed with Signals too
Hey @rodydavis let me know how you want to proceed with the remaining changes
Issue: #243
This will be a two part PR:
This adds a new utility class
DeepCollectionEquality
to thesignals_core
package. The class provides a way to compare the equality of complex data structures, such as maps, sets, and iterables, by recursively comparing their elements.The
DeepCollectionEquality
class includes:equals
method: Compares two objects for deep equality, handling maps, sets, and iterables._mapsEqual
method: Compares two maps for deep equality._iterablesEqual
method: Compares two iterables for deep equality, considering element order._setsEqual
method: Compares two sets for deep equality.Example usage:
If things look good so far, let me know where you would like to add the functionality and I can give it a go.