Skip to content
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
Open
@Kelin2025

Description

@Kelin2025

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
})

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions