deduplicatePostsMap static method

Map<String, Post> deduplicatePostsMap(
  1. Map<String, Post> postsMap, {
  2. int timeThresholdMs = 120000,
})

Deduplicates a Map<String, Post>

Implementation

static Map<String, Post> deduplicatePostsMap(Map<String, Post> postsMap, {int timeThresholdMs = 120000}) {
  final dedupedList = deduplicatePosts(postsMap.values, timeThresholdMs: timeThresholdMs);
  return {for (var p in dedupedList) p.id: p};
}