TinyBase logoTinyBase

hasSlice

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

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

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

sliceIdMaybeGetter<string>

The Id of the possible Slice (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