addEquality<D>(data, equals, hashCode): D & HasEquals
Adds equality functions to a data object. This freezes an object.
HashCode is lazily evaluated and memoized.
This function also acts as an error boundary; you may assume both arguments
for equals() are of the same type as the data object, any exceptions thrown
by the equality function will be caught and treated as false.
Adds equality functions to a data object. This freezes an object. HashCode is lazily evaluated and memoized.
This function also acts as an error boundary; you may assume both arguments for equals() are of the same type as the data object, any exceptions thrown by the equality function will be caught and treated as false.
Example