addHasSliceListener
The addHasSliceListener method registers a listener function with the Indexes object that will be called whenever a Slice is added to or removed from an Index.
addHasSliceListener(
indexId: IdOrNull,
sliceId: IdOrNull,
listener: HasSliceListener,
): string| Type | Description | |
|---|---|---|
indexId | IdOrNull | |
sliceId | IdOrNull | |
listener | HasSliceListener | The function that will be called whenever the |
| returns | string | A unique |
You can either listen to a single Slice (by specifying the Index Id and Slice Id as the method's first two parameters), or changes to any Slice (by providing null wildcards).
Both, either, or neither of the indexId and sliceId parameters can be wildcarded with null. You can listen to a specific Slice in a specific Index, any Slice in a specific Index, a specific Slice in any Index, or any Slice in any Index.
The provided listener is a HasSliceListener function, and will be called with a reference to the Indexes object, the Id of the Index, the Id of the Slice that changed, and whether it now exists.
Since
v9.1.0