Remote / foldkit-remote/maintained

ReverseIndex

interface · packages/remote/src/maintained/indexes.ts:109

interface ReverseIndex {
  readonly targetCount: number
  readonly add: (targetId: string, sourceKey: EntityKey) => void
  readonly remove: (targetId: string, sourceKey: EntityKey) => void
  readonly pointingAt: (targetId: string) => ReadonlySet<EntityKey>
}

In the guides

  • ExampleLearn / Keep a list up to date

Members

ReverseIndex.targetCount

property · packages/remote/src/maintained/indexes.ts:111

readonly targetCount: number

Number of distinct target ids currently indexed.

ReverseIndex.add

property · packages/remote/src/maintained/indexes.ts:113

readonly add: (targetId: string, sourceKey: EntityKey) => void

Record that sourceKey points at targetId.

ReverseIndex.remove

property · packages/remote/src/maintained/indexes.ts:115

readonly remove: (targetId: string, sourceKey: EntityKey) => void

Remove the link from sourceKey to targetId.

ReverseIndex.pointingAt

property · packages/remote/src/maintained/indexes.ts:117

readonly pointingAt: (targetId: string) => ReadonlySet<EntityKey>

All source keys currently pointing at targetId (O(1) lookup).