resolveRefs
function resolveRefs<TCustom>(activity, objects): DropInObject<TCustom>[];Resolve an activity’s refs against a feed page’s objects sidecar. Pure — it fetches
nothing. Refs with no stored object are SKIPPED, not returned as holes: an object may
legitimately not exist yet (the tenant posted before storing it), and a hole in the
array would push that decision onto every caller.
Because of that, NEVER index the result by position. Order follows refs, but a
skipped ref shifts everything after it: with refs: ['session:1', 'match:1'] and no
stored session:1, const [session] = resolveRefs(...) is the match. Select by
type — resolveRefs(a, objects).find((o) => o.type === 'session') — or index the
sidecar directly, since it is keyed type:id.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TCustom |
Record<string, unknown> |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
activity |
Activity<TCustom> |
objects |
| Record<string, DropInObject<TCustom>> | undefined |
Returns
Section titled “Returns”DropInObject<TCustom>[]