English
@eightkk/vue-weave / core / splitDanglingLinks
Function: splitDanglingLinks()
Call Signature
splitDanglingLinks<
L>(links,present,options?):SplitDanglingLinks<L>
Defined in: src/core/windowedData.ts:642
Splits links between loaded items into those whose both ends are present and those that point to an item that is not loaded (yet). The components throw for links to unknown items, so pass only resolved to them. Call it again with the new set of present IDs after more data arrives: a dangling link whose missing end has arrived moves to resolved. present is a set of item IDs (or anything with has, such as a Map by ID) or any iterable of them. The inputs are not modified. The ends are not validated: an end that is not a present ID (undefined, a number, '') is simply missing, so the link is dangling and missingIds holds the value as returned; a link is resolved only when both ends are present. A from or to accessor that throws makes the call throw; nothing is caught here (useWindowedData reports it through its error).
Type Parameters
L
L extends object
Parameters
links
readonly L[]
present
Iterable<string, any, any> | { has(id): boolean; }
options?
Returns
Call Signature
splitDanglingLinks<
L>(links,present,options):SplitDanglingLinks<L>
Defined in: src/core/windowedData.ts:645
Splits links between loaded items into those whose both ends are present and those that point to an item that is not loaded (yet). The components throw for links to unknown items, so pass only resolved to them. Call it again with the new set of present IDs after more data arrives: a dangling link whose missing end has arrived moves to resolved. present is a set of item IDs (or anything with has, such as a Map by ID) or any iterable of them. The inputs are not modified. The ends are not validated: an end that is not a present ID (undefined, a number, '') is simply missing, so the link is dangling and missingIds holds the value as returned; a link is resolved only when both ends are present. A from or to accessor that throws makes the call throw; nothing is caught here (useWindowedData reports it through its error).
Type Parameters
L
L
Parameters
links
readonly L[]
present
Iterable<string, any, any> | { has(id): boolean; }
options
Required<SplitDanglingLinksOptions<L>>