This repository was archived by the owner on Aug 9, 2024. It is now read-only.
This repository was archived by the owner on Aug 9, 2024. It is now read-only.
RFC: joinLists
#23
Open
Description
Case
Sometimes you need one-to-many connection between two KVs
For example, there's "Swaps" widgets and you need to gather swaps lists for each widget
Solution
Add joinLists
method
const widgetSwaps = joinLists({
kv: Widget.model.$kv,
join: Swap.model.$kv,
fn: (widget, swap) => widget.swapIds.includes(swap.id),
orderBy: (a, b) => a.timestamp - b.timestamp
})