# thenComparingComparable<U extends Comparable<U>> method

Comparator<T> thenComparingComparable<U extends Comparable<U>>(

1. U keyExtractor(
   1. T
   )

)

Chains a comparator by extracting a `Comparable` key from each element.

If this comparator returns 0, the key extractor will be used with natural ordering.

### Example

    final byNameLength = Comparator.comparing((s) => s.length);
    final thenByAlpha = byNameLength.thenComparingComparable((s) => s);

    final list = ['Ann', 'Tom', 'Bob'];
    list.sort(thenByAlpha.compare);
    print(list); // [Ann, Bob, Tom]

## Implementation

    Comparator<T> thenComparingComparable<U extends Comparable<U>>(U Function(T) keyExtractor) {
      return thenComparing(Comparator.comparing(keyExtractor));
    }