Skip to content

placePromoted

function placePromoted<TCustom>(
activities,
promoted,
opts?): FeedItem<TCustom>[];

Interleave promoted activities into a list of activities. Pure — usable outside React, and the whole of the placement policy.

The sidecar is an eligible SET, not a slot assignment: the same rows may be placed as many times as you like, and consecutive slots rotate through the set (wrapping), so two eligible rows alternate rather than one hogging every slot.

A feed shorter than position — including an empty one — still gets its first slot at the end. That is deliberate: a brand-new user with an empty feed is exactly the cold-start case promoted content exists to fill.

Type Parameter Default type
TCustom Record<string, unknown>
Parameter Type
activities Activity<TCustom>[]
promoted | PromotedActivity<TCustom>[] | undefined
opts PlacePromotedOptions

FeedItem<TCustom>[]