TinyBase logoTinyBase

hasIndex

The hasIndex function returns a reactive object reflecting whether a given Index exists in the Indexes object, and registers a listener so that any changes will update current.

hasIndex(
  indexId: MaybeGetter<string>,
  indexesOrIndexesId?: MaybeGetter<undefined | IndexesOrIndexesId>,
): {current: boolean}
TypeDescription
indexIdMaybeGetter<string>

The Id of the possible Index (or a getter returning it).

indexesOrIndexesId?MaybeGetter<undefined | IndexesOrIndexesId>

The Indexes object to use (plain or getter), or its Id.

returns{current: boolean}

A reactive object with a current boolean property.

Since

v9.1.0