RSIndexMap

See source code

A type representing a reactive store index as a map from property values to sets of record IDs. This is used to efficiently look up records by a specific property value.

type RSIndexMap<
  R extends UnknownRecord,
  Property extends string & keyof R = string & keyof R,
> = Map<R[Property], Set<IdOf<R>>>

Example

// Index mapping book titles to the IDs of books with that title
const titleIndex: RSIndexMap<Book, 'title'> = new Map([
  ['The Lathe of Heaven', new Set(['book:1'])],
  ['Animal Farm', new Set(['book:2', 'book:3'])],
])
Prev
RSIndexDiff
Next
SerializedSchema