Pular para o conteúdo principal

sortFeedItemsByPriority

@raizfc/contracts


@raizfc/contracts / sortFeedItemsByPriority

Function: sortFeedItemsByPriority()

sortFeedItemsByPriority(items): readonly Readonly<{ entityCrest?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; entityId: string; entityName: string; entityRoute: string; entityType: FeedEntityType; id: string; link?: Readonly<{ label?: string; url: string; }>; matchPresentation?: Readonly<{ away: FeedMatchParticipantDto; awayScore?: number; home: FeedMatchParticipantDto; homeScore?: number; status: PublicMatchStatus; }>; media?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; publishedAt: string; reason: FeedReasonDto; source: FeedPostSource; sourceId?: string; targetRoute: string; text: string; title: string; type: FeedPostType; }>[]

Defined in: engagement/feed.dto.ts:186

Stable sort: ties (identical boosted timestamp) break by id ascending, never by insertion order, so repeated calls over the same data always produce the same sequence (no duplicates across pages even if two items share a publish instant).

Parameters

items

readonly Readonly<{ entityCrest?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; entityId: string; entityName: string; entityRoute: string; entityType: FeedEntityType; id: string; link?: Readonly<{ label?: string; url: string; }>; matchPresentation?: Readonly<{ away: FeedMatchParticipantDto; awayScore?: number; home: FeedMatchParticipantDto; homeScore?: number; status: PublicMatchStatus; }>; media?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; publishedAt: string; reason: FeedReasonDto; source: FeedPostSource; sourceId?: string; targetRoute: string; text: string; title: string; type: FeedPostType; }>[]

Returns

readonly Readonly<{ entityCrest?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; entityId: string; entityName: string; entityRoute: string; entityType: FeedEntityType; id: string; link?: Readonly<{ label?: string; url: string; }>; matchPresentation?: Readonly<{ away: FeedMatchParticipantDto; awayScore?: number; home: FeedMatchParticipantDto; homeScore?: number; status: PublicMatchStatus; }>; media?: Readonly<{ alt?: string; height?: number; id: string; url: string; width?: number; }>; publishedAt: string; reason: FeedReasonDto; source: FeedPostSource; sourceId?: string; targetRoute: string; text: string; title: string; type: FeedPostType; }>[]